[R] lattice: emulating the par(xaxs="i") behaviour

From: Thomas Zumbrunn <t.zumbrunn_at_unibas.ch>
Date: Fri, 21 Mar 2008 18:33:07 +0100

I tried to emulate the axis interval calculation behaviour of the traditional graphics system (with par(xaxs="i")) in lattice but couldn't find a flexible solution.

Let's say a have a simple xyplot:

x <- seq(0, 1, 0.01)
xyplot(x^2 ~ x, type="l")

I want to restrict the plotting region to the data range _and_ have axis labels over the full data range like this:

xyplot(x^2 ~ x, type="l", xlim=0:1, ylim=0:1, scales=list(labels=seq(0, 1, 0.2)))

Is there a simple way to achieve this in a more general fashion (e.g. with lattice options) so that the behaviour could be applied to a whole set of plots?

Thomas Zumbrunn

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 21 Mar 2008 - 17:37:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Mar 2008 - 18:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive