RE: [R] position of a legend-object

From: Ravi Varadhan <>
Date: Fri 10 Jun 2005 - 03:52:02 EST

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 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

> -----Original Message-----
> From: [mailto:r-help-
>] On Behalf Of Carsten Steinhoff
> Sent: Thursday, June 09, 2005 1:06 PM
> To:
> 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
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> guide.html mailing list PLEASE do read the posting guide! Received on Fri Jun 10 03:56:27 2005

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