[R] Labelling curves on graphs

Frank E Harrell Jr f.harrell at vanderbilt.edu
Thu Jul 17 04:32:41 CEST 2008


Barry Rowlingson wrote:
> 2008/7/16 Ted Harding <Ted.Harding at manchester.ac.uk>:
> 
>> Hi Folks,
>> I'd be grateful for good suggestions about the following.
>>
>> I'm plotting a family of (X,Y) curves (for different levels
>> of another variable, Z): say 6 curves in all but could be
>> more or less -- it's a rather variables situation.
>>
>> I'd like to label each curve with the value of Z that it
>> corresponds to.
>>
>> But people out there must have faced it, and I'd be grateful
>> for their own feedback from the coal-face!
>>
> Isn't this why we have colour vision? Just use 6 different colours and a
> legend. Or use linestyles and colours. Trying to do neat labelling along
> general lines like contour does is going to fail in edge cases such as if
> two lines are very close together. Contour can be fairly sure the lines will
> have sensible spacing unless it's mapping cliffs.
> 
>  I looked at the underlying C code for contour a while back with a view to
> using the algorithms in another package, but I gave up pretty quickly. The
> generated contour lines and labels are quite beautiful, but the code gave me
> a headache.
> 
> Barry

Barry,

Why use color when you can use black and label the curves where they are 
most separated?  This solves problems with color blindness, xeroxing, 
and faxing.

Frank

> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list