[R] creating a plot legend

Jason Bond jbond at arg.org
Mon Feb 24 20:55:04 CET 2003


Thanks so much to all for their help.  I was wondering if there was an easy 
way to create legends in R plots.  For example, if I am plotting lines for 
subjects in a longitudinal design of the outcome by time for two different 
treatments, where the individual for treatment 1 are plotted in one color, 
and the others are plotted in another.  What I would like to do is, for 
example, have a little legend in the bottom right corner which puts the 
line color next to the treatment name.  I guess I could start messing with 
magins and try to draw text at given coordinates within the margin, but 
thought I might ask if anyone else has had success with a simpler 
solution.  Thanks so much again,

   Jason




More information about the R-help mailing list