[R] Multiple plots with one legend

David Winsemius dwinsemius at comcast.net
Sun Mar 27 01:43:57 CET 2011

On Mar 26, 2011, at 8:27 PM, mavkoup wrote:

> Ok I think I can figure that out. Which leads me to a further  
> question. My 3
> plots contain 10 time series, each with a different name and color.  
> Can I
> create the legend such that it has a line of the correct color  
> follow by the
> name of the series? I.e.

"plots" and therefore "legends" in R can take many forms. Have your  
read the Posting Guide's recommendations on how to submit a  
reproducible example yet? That would be particularly important if you  
have three different plots on the same page.

> line(with color1) NAME 1
> line(with color2) NAME 2
> ...
> I have a vector of colors I'm using and a vector of names.


David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list