[R] How to get ``nn%'' in axis values

Duncan Murdoch dmurdoch at pair.com
Fri Aug 31 00:13:36 CEST 2001


On Thu, 30 Aug 2001 14:18:49 -0500 (CDT), you wrote:

>I would like to make the print format of the axis value labels appear as
>``nn%'' instead of just the numbers. Is there a way to do this? 

Yes, you say "axes=F" in the initial plot, then you can put labels
anywhere with any strings at all, in a call to axis().

For example:

x <- runif(10)
y <- runif(10)
plot(x,y,axes=F)
xat <- pretty(x)
yat <- pretty(y)
axis(1,at=xat,label=paste(100*xat,'%',sep=''))
axis(2,at=yat,label=paste(100*yat,'%',sep=''))
box()

>Also, the x axis value labels on my horizontal barplot are rotated 90 degrees
>(perpendicular to the axis) no matter what I do. I tried las=1 but that didn't
>work. Is this doable?

I believe that depends on the graphics driver, but I've never played
with las.  If it works for other kinds of plots but not barplots, then
I'd submit it as a bug report.

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