[R] Legend

David Winsemius dwinsemius at comcast.net
Fri Oct 2 15:57:56 CEST 2009

On Oct 2, 2009, at 9:46 AM, Ashta wrote:

> I have more than three lines in one  and I want to add a legend  for  
> each
> line
> abline( m1, col = 'red' )
> ablime( m2, col = 'blue' )
> abline( m3, col = 'purple' )
> How can I add a legend? . Is it also possible to increase the  
> thickness of
> the lines?

?abline and this time pay closer attention to the lwd parameter.

The answer to the legend question may depend on the details of the  
plot call, but I am unclear why you have not yet tried:


I am getting the impression that you are not taking advantage of R's  
help system.

David Winsemius

More information about the R-help mailing list