Dear Lattice bit-meddlers, 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? I have just tried for an hour to find out, with no success whatsoever. I looked in Grid for something that would return such data, but got lost. I looked at tracebacks of panel calls, but couldn't see the forest for the trees. Lonely, sad, and crying... ;-) Lutz Prof. Dr. Lutz Prechelt; prechelt at inf.fu-berlin.de Institut fuer Informatik; Freie Universitaet Berlin Takustr. 9; 14195 Berlin; Germany +49 30 838 75115; http://www.inf.fu-berlin.de/inst/ag-se/
On Monday 03 May 2004 09:36, Lutz Prechelt wrote:> Dear Lattice bit-meddlers, > > 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? > > I have just tried for an hour to find out, > with no success whatsoever. > I looked in Grid for something that would > return such data, but got lost. > I looked at tracebacks of panel calls, but > couldn't see the forest for the trees.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: panel = function(...) { cvp = grid::current.viewport() print(cvp$xscale) print(cvp$yscale) } Deepayan
> >>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