On Thu, Oct 1, 2009 at 6:57 AM, Ashta <sewa...@gmail.com> wrote:

> I am trying to plot a line graph for 3 or more regression lines
>
> abline(m1)
> abline(m2)
> abline(m3)
>
> Can I change the color of each line? if so how?
>
> Thanks in advance
> Ashta
>

Try passing the 'col' parameter to abline:

abline( m1, col = 'red' )
ablime( m1, col = 'blue' )
abline( m1, col = 'purple' )

See ?par for other plot parameters like col that can be set this way. ?rgb
gives an example of setting color by RGB value. Other specifications such as
HSV are possible. The colors() function will show a list of all built colors
that may be specified using a string such as 'red' . ?rainbow will show
information concerning built in functions for generating color palettes. The
RColorBrewer package also contains some great palettes.

Also, a help search such as:

??'colors'

Will turn up all kinds of other functions that may deal with setting or
creating colors.

Hope this helps!

-Charlie

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to