[R] Legends on plots

Marc Feldesman feldesmanm at pdx.edu
Thu Dec 21 23:49:03 CET 2000

I'm trying to develop a systematic way of placing legends on (among other 
things) scatterplots of grouped data.  The journals in my field can be very 
fussy about the placement of figure legends.  Typically they want them to 
be in either of two places - the upper left corner of the plotting area, 
not obscuring any data points, or outside the plotting area in the lower 
right hand corner of the figure with the bottom of the legend aligned with 
the x-axis line.

My preference is to place them in the upper left-hand corner of the 
plotting area if space is available.  I can do this interactively with 
locator(1), and I can place them directly by querying par("usr") to find 
the coordinates of the upper left-hand corner.  I prefer the latter 
solution, but obviously I have to know that there will be no data points 
obscured by this placement.   What is the recommended programming solution 
to determine whether enough plot space exists to place the legend in this 


Dr. Marc R. Feldesman
Professor and Chairman
Anthropology Department
Portland State University
1721 SW Broadway
Portland, Oregon 97201
email:  feldesmanm at pdx.edu
phone:  503-725-3081
fax:    503-725-3905
PGP Key Available On Request

"Anyway, no drug, not even alcohol, causes the fundamental ills of society.
If we're looking for the source of our troubles, we shouldn't test people
for drugs, we should test them for stupidity, ignorance, greed and love of
power."   P.J. O'Rourke

Powered by Optiplochoerus and Windows 2000 (scary isn't it?)

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list