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

0 views
Skip to first unread message

Peng Yu

unread,
Nov 20, 2009, 6:15:54 PM11/20/09
to r-h...@stat.math.ethz.ch
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?

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Jim Lemon

unread,
Nov 21, 2009, 6:20:05 AM11/21/09
to Peng Yu, r-h...@stat.math.ethz.ch
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

Reply all
Reply to author
Forward
0 new messages