rotating axis labels in R

在R中,如何将(条形)图的y轴标签与X轴平行而不是平行于Y轴?


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)


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.

正如MaciejJończyk所说,您可能还需要增加利润

par(las=2)
par(mar=c(8,8,1,1)) # adjust as needed
plot(...)
链接地址: http://www.djcxy.com/p/59844.html

上一篇: Python,Matplotlib,subplot:如何设置轴范围?

下一篇: 在R中旋转轴标签