【发布时间】:2012-04-23 21:13:00
【问题描述】:
我在一个情节中有一个图例,一条线(来自 abline 语句)穿过它。我怎样才能使 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")
最后:有没有办法在图例语句中引入换行符?
【问题讨论】:
-
为什么这个问题没有被标记为已回答?