Skip to content
Prev 8406 / 63421 Next

Wandering usr values in par(no.readonly=TRUW) (PR#2283)

--==_Exmh_1801894504P
Content-Type: text/plain; charset=us-ascii

Dear R folks,

Initially I had a plotting routine using logarithmic y-axes that failed after
repeated calls if I tried to restore the graphical parameters (which I wanted to
do because I used `layout' within the routine. I tried to isolate the problem
and found out that the following code with logarithmic axis is sufficient for
reproducing the failure:
function (x=1:2,y=1:2) 
{
   op <- par(no.readonly=TRUE)
   on.exit(par(op))
   cat(op$usr, "\n")
   plot(x, y, log="y")
   #par(op)
   invisible(op)
}

Here is a session with the typical error message (Infinite axis extents):
[1] 0 1 0 1
0 1 0 1 
[1] 0 1 0 1
0 1 1 10 
[1]  0  1  1 10
0 1 10 1e+10 
Error in par(op) : Infinite axis extents [GPretty(1e+10,inf,5)]

So this happens only with a repeated call to logarithmic axes.

I found out this feature sometimes back in R-1.5*, but I regarded that as my 
own bug. It started to disturb me yesterday when I had a live R session in my 
lectures, and got to edit away the par-restoring code to continue.

Best wishes, Jari Oksanen


--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 1
 minor = 6.1
 year = 2002
 month = 11
 day = 01
 language = R

Search Path:
 .GlobalEnv, package:ctest, Autoloads, package:base