[R] comma as decimal separator in plots

Paul Murrell p.murrell at auckland.ac.nz
Thu Nov 22 21:07:35 CET 2001


Hi


> Is there any way to display numbers with comma as decimal 
> separator, i.e., "5,4" instead of "5.4", in plots (x and y 
> axis, expressions)?


You could try something with axis() and chartr(), like ...

    par(mfrow=c(2,1))
    plot(1:10/11, rep(1, 10), main="Standard X-Axis")    
    plot(1:10/11, rep(1, 10), main="Customised X-Axis", axes=F)
    axis(1, at=pretty(1:10/11), 
        labels=chartr(".", ",", as.character(pretty(1:10/11))))
    axis(2)
    box()

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