简体   繁体   English

如何在R中的twoord.plot中旋转Y轴标签?

[英]How to rotate Y axis labels in twoord.plot in R?

Does anyone know how to rotate the Y axis labels in the function twoord.plot in R? 有谁知道如何在R中的twoord.plot函数中旋转Y轴标签? Also, how about resizing the font of the Y axis labels? 另外,如何调整Y轴标签的字体大小?

Under par: I just picked a random plot that comes with twoord.plot package. 在同等条件下:我只是选择了twoord.plot包随附的随机图。

 x <- rnorm(100,100,10)

First you need to rotate the Y axis: 首先,您需要旋转Y轴:

 par(las = 1) # rotates the y axis values for every plot you make from now on unless otherwise specified

Next, plot your graph without a Y axis: 接下来,绘制没有Y轴的图形:

 plotH(x,x,yaxt = 'n') # no Y axis

Then, you need to add the Y axis 然后,您需要添加Y轴

  axis(2,cex.axis = 0.5) # where 2 specifies the Y axis and 0.5 is half (0.5) of the font size as before.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM