[R] lattice/ylim: how to fix ylim, but have ylim dynamically calculated?
dwinsemius at comcast.net
Sun Feb 14 18:54:29 CET 2010
On Feb 14, 2010, at 10:33 AM, Johannes Graumann wrote:
> When drawing "barcharts", I find it not helpful if ylim != 0 -
> bars for a
> quantity of 0, that do not show a length of 0 are quite non-intuitive.
> I have tried to study
> > library(lattice)
> > panel.barchart
> but am unable to figure out where ylim is taken care of and how one
> fix ylim to 0 for barcharts ...
> Can anyone point out how to tackle this?
Looking at Sarkar's "Lattice" text in chapter 8 section 3 "Limits and
Aspect Ratio", it appears from subsection 1 that the prepanel function
can used to supply values of xlim and ylim values. From subsection 2
he clarifies that xlim and ylim can also be specified on a per panel
basis (and here I am guessing that this would be within a scales
argument) when relation="free". At the end of that section he offers
two examples using ylim: the first is not plotted but the second uses
the prepanel mechanism for Fig 8.1 and that is probably available on
the Lattice website.
In the same subsection is offered an alternative to specifying an
explicit scales$y$limits to be interpreted as ylim values.
My hope it that these ideas and references will be of some use in
identifying productive places to look for further documentation.
David Winsemius, MD
West Hartford, CT
More information about the R-help