Re: [R] position of a legend-object

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Fri 10 Jun 2005 - 04:09:17 EST

Ravi Varadhan wrote:
> You can use locator(1) as an argument in the "legend" function to manually
> position the legend, i.e. after your plot is plotted, the system will wait
> for you to indicate (by clicking the mouse) where the legend should be
> placed.
>
> legend(locator(1), ...)
>
> Hope this helps,
> Ravi.
>
> --------------------------------------------------------------------------
> Ravi Varadhan, Ph.D.
> Assistant Professor, The Center on Aging and Health
> Division of Geriatric Medicine and Gerontology
> Johns Hopkins University
> Ph: (410) 502-2619
> Fax: (410) 614-9625
> Email: rvaradhan@jhmi.edu
> --------------------------------------------------------------------------
>

>>-----Original Message-----
>>From: r-help-bounces@stat.math.ethz.ch [mailto:r-help-
>>bounces@stat.math.ethz.ch] On Behalf Of Carsten Steinhoff
>>Sent: Thursday, June 09, 2005 1:06 PM
>>To: r-help@stat.math.ethz.ch
>>Subject: [R] position of a legend-object
>>
>>Hello,
>>
>>I've written a function that plots a few functions in a diagram.
>>The xlim and or ylim is not always the same, and set automatically by R.
>>A legend is part of this object.
>>Now the problem is: where to put the legend? Me would help a function that
>>returns the limits and scaling of the axis.
>>
>>Thanks for your help.
>>
>>Carsten

There are functions in the Hmisc package to help too (especially labcurve and xYplot). You can have a function put a legend in the most empty portion of a graph automatically with these functions.

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Jun 10 04:08:49 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:28 EST