[R] Lattice: finding out xlim within panel function

Lutz Prechelt prechelt at pcpool.mi.fu-berlin.de
Tue May 4 18:26:15 CEST 2004


> >>while within a panel function for xyplot, how can I
> >>find out the values of (effectively) xlim and
> >>ylim -- no matter whether they have been set
> >>explicitly or chosen by Lattice itself?
...
> > Not surprising, since there's no documented way to do this. 
> > You could 
> > try something along these lines, but this exact construct is not 
> > guaranteed to work in future versions of grid:
> > 
> >     cvp = grid::current.viewport() 
> >     print(cvp$xscale)
...
> Can you tell me 
> more about what you are trying to do?

I am writing a panel function that will (among other
things) plot a regression line for a scatter plot
and add curves for confidence or prediction intervals.
I want the intervals to cover not only the
x-range of the data, but the whole length of the
axis.

And while for drawing the line I need not know
the size of the scale (by using abline),
there is nobody taking it off me to decide where
to start and stop drawing the curves for the
intervals.

  Lutz




More information about the R-help mailing list