如何在 R 中的绘图区域之外画一条线或添加文本?
感谢您的阅读。我发现我无法在绘图区域之外绘制线/点或添加文本。如果我从绘图内部(轴内)区域到 xlab 主标题区域绘制一条线,则仅显示绘图内的部分。在多重绘图 (mfrow) 中,线/点只会在最后一个活动绘图内绘制。
plot(0);
l=locator(2,type='n');
lines(l, type='l');
有什么办法解决这个问题吗?谢谢!
Thank you for reading. I find that I am unable to draw lines/points or add text outside of the plot area. If I draw a line from inside the plot (within the axis) area to the area of the xlab main title areas only the part within the plot shows. In a multiple plot graph (mfrow) the line/point will only be drawn inside the last active plot.
plot(0);
l=locator(2,type='n');
lines(l, type='l');
Any solution to this problem? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
xpd 参数控制可以绘制的位置。使用 par()$xpd 检查当前值,然后尝试设置 par(xpd=NA)。
来自 par 帮助:
The xpd parameter controls where you can draw. Check the current value with par()$xpd and then try setting par(xpd=NA).
From the par help: