Skip to content
Back to formatted view

Raw Message

Message-ID: <009e01c314b1$33c5e500$0201a8c0@MARC>
Date: 2003-05-07T15:56:17Z
From: Marc Schwartz
Subject: plot vertical labels along x axis
In-Reply-To: <200305070825.08169.anna@ptolemy.arc.nasa.gov>

>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch 
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Anna H. Pryor
>Sent: Wednesday, May 07, 2003 10:25 AM
>To: R-help mailing list
>Subject: [R] plot vertical labels along x axis
>
>
>
>I know how to print my own labels along the x axis:
>
>plot(1:10,xlab = "My label", axes = FALSE)
>
>axis(1,at=seq(1,10,by=2),labels=c("first","second","third","fou
>rth","fifth"))
>
>
>Is there a way to make the labels print vertically along the 
>axis rather than 
>horizontally?  (I'm not sure if this is even going to look all 
>right, but I 
>want to check it out if it is possible.)
>
>Anna


Try this sequence:

plot(1:10,xlab = "My label", axes = FALSE)
axis(1, at=seq(1,10,by=2),
labels=c("first","second","third","fourth","fifth"), las = 2)


See ?par for more information on the use of the 'las = 2' argument,
which sets the labels to be printed perpendicular to the axis.

Hope that helps,

Marc Schwartz