r - Legend not displaying color -


i have drawn 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 , 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 legend not getting coloured. wrong here ?

try using pch:

legend("topright",        legend=c("gini < 0.05","gini > 0.6"),         pch=15,        col=cols) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -