我在一张图中有一个带有一条直线(来自 abline 语句)的图例。如何实现在图例附近直线不可见?这可以通过将图例背景设置为白色、没有边框来实现,但我该如何做到这一点呢?
假设图形应该是这样的:
windows.options(width=30, height=12)
plot(1:10)
abline(v=seq(1,10,1), col='grey', lty='dotted')
legend(4.8, 3, "This legend text should not be disturbed by the dotted grey lines")
更进一步的问题是: 如果图例与散点图上的点产生干扰:如何实现在图例附近让 ablines 不可见(如上所示),但是散点仍然可见?
windows.options(width=30, height=12)
plot(1:10)
abline(v=seq(1,10,1), col='grey', lty='dotted')
legend(1, 5, "This legend text should not be disturbed by the dotted grey lines, but the plotted dots should still be visible")
最后:是否有办法在图例说明中添加换行?