I have drawn a plot in R
.
plot(NA,xlim=c(0,1),ylim=c(0,1), xlab=expression(delta),ylab="K", xaxs="i",yaxs="i",main = "Zones of extreme equality and inequality in BO1") # Empty plot
cols <- c("red","black")
legend("topright",legend=c("Gini < 0.05","Gini > 0.6"), density=c(NA,NA), angle=c(NA,NA), col=cols)
The box in the legend is not getting coloured. What is wrong here ?
Try using pch
:
legend("topright",
legend=c("Gini < 0.05","Gini > 0.6"),
pch=15,
col=cols)
You can also just put the colors in fill:
legend("topright",legend=c("Gini < 0.05","Gini > 0.6"), fill=cols)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With