R-beta: par --- how to do custom axes

Martin Maechler maechler at stat.math.ethz.ch
Wed May 13 12:04:54 CEST 1998


Some of your problems should be gone
once you upgrade to  0.61.3 (instead 0.61.1).

0.61.2 und xx.3 have explicitly been  Bug-fix releases  
``that everybody should install'' (:-)   --- of course, not really)

>> 2. In a log="x" plot, labels are drawn in exp.mode: 1e-02, 1e-01,..
>>    How can I change it to 0.01, 0.1, ... ?

You can work with
	axes = FALSE
and later explicit

	axis(1, at = ..., labels= ...)
	axis(2, at = ..., labels= ...)

Here is an example ((which also exhibits a long standing bug for pch="."
		     AND a bug in 0.62 [no ticks !!]))

##--- Log-Log Plot  with  custom axes
lx <- seq(1,5, length=41)
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
y <- exp(-.5*lx^2)
op <- par(mfrow=c(2,1), mar=par("mar")+c(0,1,0,0))

plot(10^lx, y, log="xy", type="l", col="purple",
     main="Log-Log plot", ylab=yl, xlab="x")

plot(10^lx, y, log="xy", type="o", pch='.', col="forestgreen",
     main="Log-Log plot with custom axes", ylab=yl, xlab="x",
     axes = FALSE, frame.plot = TRUE)

axis(1, at = my.at <- 10^(1:5), labels = formatC(my.at))
at.y <- 10^(-5:-1)
axis(2, at = at.y, labels = formatC(at.y))
par(op)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list