[R] Spacing between lattice panels

From: <Richard.Cotton_at_hsl.gov.uk>
Date: Tue, 06 May 2008 13:23:31 +0100


I'm trying to set up a lattice plot with two y-axes for each panel. (Yes, I know that multiple y-axes are generally a bad idea; the graph is for someone else and they want it that way.) I've used a custom yscale.component in xyplot to achieve this:

myyscale.component <- function(...)
{
  ans <- yscale.components.default(...)

  ans$right <- ans$left
  foo <- ans$right$labels$at
  ans$right$labels$labels <- as.character(10*foo)
  ans
}

xyplot(Sepal.Length ~ Petal.Length| Species, data = iris, scales = list(y=list(relation="free", alternating=3, rot=0)), yscale.component=myyscale.component)  

The problem is that the panels are too close together. This appears to be because (according to the help documentation) xyplot ignores the alternating argument when relation is not "same". I presume that manually setting some plotting parameters with trellis.par.set() will allow me to adjust the spacing between the panels, though I can't figure out which ones to change.

Is there a way to get lattice to properly space the panels, or failing that, how do I manually space them?

Regards,
Richie.

Mathematical Sciences Unit
HSL



ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}

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 Tue 06 May 2008 - 12:28:12 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 Tue 06 May 2008 - 14:30:35 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