[R] Adding legends to a plot

2008-09-30 Thread liujb
Hello, I have a time series plot drawn using 3 different colored lines, each line corresponds to different category group. I'd like to put legends on the plot. I am using legend to do this, however, I can either specify lty or col in legend. Will I be able to do the following in the legend box:

Re: [R] Adding legends to a plot

2008-09-30 Thread Jorge Ivan Velez
Dear Julia, Try this: plot(1:10) legend(topleft, legend=c(g1, g2, g3), col=c('black','red','blue'), lty=1,lwd=1.5) # or plot(1:10) legend(topleft, legend=c(g1, g2, g3), text.col=c('black','red','blue'),ncol=3) HTH, Jorge On Tue, Sep 30, 2008 at 3:03 PM, liujb [EMAIL PROTECTED] wrote: