有没有一种方法可以在图例中将type = "b"
作为线型显示?
我希望我的图例与图中的点相同:
x <- c(1:3)
plot(x, x, type="b")
legend("bottomright", c("dinges"), cex=1.2, pch=c(21), lty=1, bty="n")
pt.bg = 'white'
。这将使点的背景颜色变白。plot(x, x, type="b")
legend("bottomright", c("dinges"), cex=1.2, pch = 21,pt.bg = 'white', lty = 1, bty="n")
type="b"
似乎不可能实现。 - thijs van den bergh我正在尝试同样的任务。在legend()
调用中包括lty
和pch
参数可以完成任务。