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

jarioksa@sun3.oulu.fi jarioksa@sun3.oulu.fi
Tue, 12 Nov 2002 12:51:41 +0100 (MET)


--==_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:

> plot2.log
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):

> op <- par(no.readonly=TRUE)
> op$usr
[1] 0 1 0 1
> plot2.log()$usr
0 1 0 1 
[1] 0 1 0 1
> plot2.log()$usr
0 1 1 10 
[1]  0  1  1 10
> plot2.log()$usr
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

-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
Ph. +358 8 5531526, cell +358 40 5136529, fax +358 8 5531061
email jari.oksanen@oulu.fi, homepage http://cc.oulu.fi/~jarioksa/



--==_Exmh_1801894504P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Exmh version 2.1.1 10/15/1999

iD8DBQE90OsUWnxFzE9NjaURAcwSAJwJdXXP/qgUyCFahR4GsWbBxVl0YACeKBPe
AFIwTfrg/l7H0fr0HJONcaI=
=mkza
-----END PGP SIGNATURE-----

--==_Exmh_1801894504P--

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._