Reputation: 3521
I'm using R to plot charts and their legends but I found some issues while drawing a legend with a border.
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")
The border does not completely surround the green box. How can I fix this?
Upvotes: 1
Views: 914
Reputation: 11893
There is a conflict within the legend()
call between fill="green"
, and pch=c(15, 15, 15, 17)
. If I drop the latter, I get what I think you are looking for:
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")
Upvotes: 1