如何在R中绘制带边框的图例?

时间:2013-04-22 02:56:42

标签: r plot legend

我正在使用R绘制图表及其图例但我在绘制带边框的图例时发现了一些问题。

plot.new()
legend(x=0, y=.15, c("Some Text"), cex=1, pt.cex =1.4, col=c("green"), 
       bty="n", fill="green", pch=c(15, 15, 15, 17), border="black")

enter image description here

边框没有完全包围绿框。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

legend()fill="green"之间pch=c(15, 15, 15, 17)来电之间存在冲突。如果我放弃后者,我会得到我认为你在寻找的东西:

plot.new()
legend(x=0,y=.15, c("Some Text"), cex=1,pt.cex =1.4,col=c("green"), 
       bty="n",fill="green", border="black")

enter image description here

相关问题