将 R 绘图 x 轴设置为在 y=0 处显示
通常,当我绘制一些 R 线图并设置 ylim=c(0,some_value) 时,x 轴和 y=0 之间有很小的空间。
我希望 y 轴精确显示在 y=0 处,因此点 (x,0) 将绘制在 y 轴上(而不是上面)。
Usually when I plot some R line plot and set ylim=c(0,some_value)
, there is small space between the x axis and y=0.
I would like the y axis to show exactly at y=0 so points (x,0) will be plotted on the y axis (and not above).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要样式为“i”的图形参数
xaxs
和yaxs
:请参阅
?par
:You probably want the graphical parameters
xaxs
andyaxs
with style "i":See
?par
:另一种选择是使用axes=F禁用绘图中的轴绘制,然后使用axis命令单独放置轴,并使用pos选项控制轴间距。
Another option is to disable the axis plotting in plot using
axes=F
and then put the axes in separately using the axis command, with thepos
option controlling the axis spacing.