[R] How to get the scale limits in lattice plot

James Rome jamesrome at gmail.com
Fri Apr 2 02:05:08 CEST 2010

The key was to use grid.text() inside the panel function. It allows you
to specify things in 0-1 "npc" units.

On 4/1/10 12:23 PM, David Winsemius wrote:
> On Apr 1, 2010, at 11:53 AM, James Rome wrote:
>> I am drawing a density histogram, and want to label the plots with the
>> mean using ltext(). But I need the x,y coordinates to feed into ltext,
>> and I can't calculate them easily from my data. Is there a way to get
>> the x and y ranges being used for the plot, so I can put the text at the
>> correct position in the panel.function?
> No code .... so what a "density histogram" might be is still vague,
> but perhaps you are using density() and if so, have you looked at the
> "Value" section of that function's help page? (The same advice would
> apply were you using one of the (several) histogram functions.

More information about the R-help mailing list