[R] axis labels vertically

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Fri Jun 17 12:30:34 CEST 2005



BoM DS wrote:
> Hi,
> 
> I have a plot and a custom axis labeling, e.g.
> 
>   x<-c(...) 
>   plot(x,axes=FALSE)
>   axis(2)
>   axis(1,1:50,c("label1",...,"label50"))
> 
> now since the labels are quite long, only a few fit on the page.
> Can I rotate each label by 90 degree counterclockwise 
> (so that they are vertical)

You should (re-)read ?axis, which points you to the "las" parameter:

x <- 1:50
plot(x, axes = FALSE)
axis(1, x, paste("label", x), las = 2, cex.axis = 0.5)
axis(2)
box()


--sundar




More information about the R-help mailing list