[R] [Fwd: Re: Plotting log-axis with the exponential base to

Mark Difford mark_difford at yahoo.co.uk
Tue May 11 22:15:29 CEST 2010


Hi All,

You can also add a line using lines() if you transform in the call using the
same log-base---but not via R's log="y" argument (because of what's stored
in par("yaxp")).

##
par(mfrow=c(1,3))
plot(1:10, log="y")
lines(log10(1:10))
par("yaxp")

plot(log10(1:10), yaxt="n")
axis(side=2, at=sapply(c(1,2,5,10), FUN=function(x) log10(x)),
labels=c(1,2,5,10))
lines(log10(1:10))
par("yaxp")

plot(log(1:10), yaxt="n")
axis(side=2, at=sapply(c(1,2,5,10), FUN=function(x) log(x)),
labels=c(1,2,5,10))
lines(log(1:10))
par("yaxp")

Regards, Mark.
-- 
View this message in context: http://r.789695.n4.nabble.com/Fwd-Re-Plotting-log-axis-with-the-exponential-base-to-a-plot-with-the-default-logarithm-base-10-tp2172435p2182338.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list