[Rd] clipped lines have wrong slope in log plot (PR#839)
jason@cs.rochester.edu
jason@cs.rochester.edu
Mon, 5 Feb 2001 02:17:21 +0100 (MET)
Hi,
I'm using R version 1.2.0 (2000-12-15), on RedHat Linux 6.2 (kernel 2.2.14).
The following command ought to plot a straight-line on a log-log
graph but instead plots two line segments, both with the wrong
slope:
plot(c(1,10,100),c(100,10,1),type="l",xlim=c(1,20),ylim=c(1,20),log="xy")
Only clipped lines seem to have this problem. Changing to type "b"
or enlarging the ranges fixes it:
plot(c(1,10,100),c(100,10,1),type="b",xlim=c(1,20),ylim=c(1,20),log="xy")
plot(c(1,10,100),c(100,10,1),type="l",xlim=c(1,100),ylim=c(1,100),log="xy")
abline has the same problem. Try following the above calls with abline(2,-1).
(This is supposed to plot a straight line in the log-log domain, and
does, but it's the wrong straight line.)
I can also get the problem where only one axis is logarithmic.
Let's untransform the x-axis from the original command:
plot(log(c(1,10,100)),c(100,10,1),type="l",xlim=log(c(1,20)),ylim=c(1,20),log="y")
Thanks! - Jason Eisner
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._