[R] Rotation of axis labels

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jan 30 12:55:19 CET 2002


Sven Garbade wrote:
> 
> Hi all,
> 
> I can I rotate the x-axis labels 45 degree in clockwise direction? I`ve
> tried
> 
> > axis(1, ..., las=2)
> 
> but this gives labels vertical to the axis, and las=0 or las=1 always
> parallel axis labels.


I think that's not possible with axis().

One way is to use text() as in this quick hack:

 plot(x, y, xaxt="n")
 axis(1, labels=FALSE)
 pr <- pretty(x)
 par(xpd=TRUE)
 text(pr, par("usr")[3], pr, adj=0, srt=-90)

Surely that's not perfect!

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