Martin Maechler
1997-Oct-28 17:37 UTC
R-alpha: Bug[?] in axis(.) -- using format(.) for labels can give nonsense
To see what I mean, try x11() par(mfrow=c(2,1)) x <- 1:100 plot(x, sin(pi*x/100)) options(digits= 20) plot(x, sin(pi*x/100)) The problem really is in axis(.) which uses format(.) for the axis labels. I think the result of axis(.) should NOT be influenced by options()$digits. Should I change it? -- Martin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Peter Dalgaard BSA
1997-Oct-29 01:28 UTC
R-alpha: Bug[?] in axis(.) -- using format(.) for labels can give nonsense
Martin Maechler <maechler@stat.math.ethz.ch> writes:> > To see what I mean, > try > > x11() > par(mfrow=c(2,1)) > x <- 1:100 > plot(x, sin(pi*x/100)) > options(digits= 20) > plot(x, sin(pi*x/100)) > > The problem really is in axis(.) which uses format(.) for the axis > labels. > I think the result of axis(.) should NOT be influenced by > > options()$digits. > > Should I change it?Hm. The root of the problem is this:> options(digits= 20) > 0:5*0.1[1] 0.00000000000000000 0.10000000000000001 0.20000000000000001 [4] 0.30000000000000004 0.40000000000000002 0.50000000000000000 I.e. the plot labels get a large number of digits because of numerical inaccuracy, and then there's only room for one of them on the axis. I say you deserve what you get... I'm a bit more worried by options(digits=1) plot(seq(50.2,50.5,0.1)) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=