2013-04-22 62 views
1

我使用R绘制图表和他们的传说,但我发现一些问题,同时绘制带有边框的图例。如何用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

fill="green"pch=c(15, 15, 15, 17)之间的legend()调用中存在冲突。如果我放弃了后者,我得到我觉得你什么都在寻找:

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