[R] How to put x-axis labels vertically?

Jim Lemon jim at bitwrit.com.au
Sat Nov 21 12:20:05 CET 2009


On 11/21/2009 10:15 AM, Peng Yu wrote:
> image(array,axes=F)
> axis(side=1,at=seq(from=par()$usr[1],to=par()$usr[2],length=size),labels=some_labels)
>
> I have the above code to plot a heatmap. But I want to make the labels
> on the x-axis vertical. Could somebody let me know how to do it?
>
> ______________________________________________
>    
Hi Peng,
Two ways:

par(las=2) # make the labels perpendicular to the axis

OR

par(las=3) # make the labels vertical

Note that these will have different effects on your y axis labels.

Jim




More information about the R-help mailing list