有没有办法获取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")
关于r - 如何在图例中获取 "type=b"行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18233236/