[R] lattice: scales beginning at zero with relation="free"

Deepayan Sarkar deepayan at stat.wisc.edu
Tue Feb 10 20:47:28 CET 2004


On Tuesday 10 February 2004 11:27, Wolfram Fischer wrote:

> Is there an easy way to have scales beginning with zero and
> ending with the local maximum data value of each panel
> when using a lattice function with ``scales=list( relation="free" )''?

Add 

prepanel = function(x, y, ...) list(xlim = c(0, max(x)), ylim = c(0, max(y)))

If you want this for only one of the axes, just leave out the other component. 
If you want to suppress the automatic extension of the limits, you need to 
add axs = "i" in the appropriate component of scales.

Deepayan




More information about the R-help mailing list