plot - Make doted lines in r-statictic legend -


i´ve tried legend plot different lines. lines black have used lwd , lty separate them each other. looks great, want make legend explains line which. works fine lwd lines when i´m trying same lty lines error message:

>error in segments(x1, y1, x2, y2, ...) :    invalid line type: must length 2, 4, 6 or 8 

the command i've used plotting legend is

legend('topleft', legend= c("red light","blue light") , lwd=c("1","2")) 

this first 2 have tried command:

legend('topleft', legend= c("green light","orange light") , lwd=c("1","2")) 

i'm not quite sure want, help:

plot(0, 0) legend('topleft', legend= c("red light","blue light"), lwd=1:2, lty=1:2) 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -