In R, how do I make a (bar)plot's y axis labels parallel to the X axis instead of parallel to the Y axis?
+4
A:
Not sure if this is what you mean, but try setting las=1
. Here's an example:
require(grDevices)
tN <- table(Ni <- stats::rpois(100, lambda=5))
r <- barplot(tN, col=rainbow(20), las=1)
That represents the style of axis labels. (0=parallel, 1=all horizontal, 2=all perpendicular to axis, 3=all vertical)
Shane
2009-12-01 20:56:12
+1
A:
Use par(las=1)
.
See ?par
:
las
numeric in {0,1,2,3}; the style of axis labels.
0: always parallel to the axis [default],
1: always horizontal,
2: always perpendicular to the axis,
3: always vertical.
rcs
2009-12-01 20:56:27