[R] format for tick labels

Paul Murrell paul at stat.auckland.ac.nz
Tue May 29 23:03:12 CEST 2001


Hi


> I checked the archives, and I couldn't find anything pertaining to this:
>
> How do I control format (scientific notation versus decimal, e.g.) on tick
> labels?


You might want to look at axis() and formatC().  For example, try ...

    par(mfrow=c(2,1))
    x <- c(0, 100, 10000, 1000000)
    y <- 1:4
    plot(x, y)
    at <- pretty(x)
    plot(x, y, axes=F)
    box()
    axis(1, at=at, labels=formatC(at, format="f", digits=0))

Hope that helps

Paul



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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