R 中的旋转轴标签
如何使(条形)图的 y 轴标签平行于 X 轴而不是平行于 Y 轴?
How do I make a (bar) plot's y axis labels parallel to the X axis instead of parallel to the Y axis?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不确定这是否是您的意思,但请尝试设置
las=1
。这是一个示例:表示轴标签的样式。 (0=平行,1=全部水平,2=全部垂直于轴,3=全部垂直)
Not sure if this is what you mean, but try setting
las=1
. Here's an example:That represents the style of axis labels. (0=parallel, 1=all horizontal, 2=all perpendicular to axis, 3=all vertical)
使用
par(las=1)
。请参阅
?par
:Use
par(las=1)
.See
?par
:正如 Maciej Jończyk 提到的,您可能还需要增加利润
As Maciej Jończyk mentioned, you may also need to increase margins
您需要使用 theme() 函数,如下所示将 x 轴标签旋转 90 度:
You need to use theme() function as follows rotating x-axis labels by 90 degrees:
首先,为图表创建数据
其次,为图表文件命名
第三,绘制条形图
最后,保存文件
输出:
First, create the data for the chart
Second, give the name for a chart file
Third, Plot the bar chart
Finally, save the file
Output: