2013-04-22 32 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