Re: [R] Lattice : factor levels in the margins

From: Deepayan Sarkar <deepayan_at_stat.wisc.edu>
Date: Fri 25 Mar 2005 - 15:31:17 EST

On Thursday 24 March 2005 17:31, Paul Murrell wrote:
> Hi
>
> Yves Brostaux wrote:
> > Hello !
> >
> > I'm struggling again against lattice graprhics. ;) I'm trying to
> > produce a conditionnal xyplot with two conditionning factors (let's
> > say A and B). I want the levels of those factors (A1, A2, etc) to
> > show in the margins of the lattice plot, not in the strips between
> > the panels.
> >
> > A1 A2 A3
> >
> > plot11 plot12 plot13 B1
> >
> > plot21 plot22 plot23 B2
> >
> >
> > I managed to remove the strips with strip=FALSE, but now I can't
> > find how to write the levels of the factors in the margin in front
> > of their respective lines/columns. It doesn't seems that xlab and
> > ylab arguments could help doing this, as I can't insert multiple
> > xlab's (x variable and A levels, or y variable and B levels) and
> > can't decide which side to use for writing them.
> >
> > Does anybody have a hint ? Thank you very much !
>
> Here's one approach, using trellis.focus() and grid.text(). This
> particular example is obviously hand-tuned to the example data set,
> but it shouldn't be too hard to generalise. I don't think you can do
> this via a panel function because output is clipped to the current
> panel for panel functions (Deepayan Sarkar may be able to confirm or
> deny that).

That can be overridden with

par.settings = list(clip = list(panel = "off"))

The problem with doing this inside the panel function is that the panel function has no way of knowing (in general) where in the eventual layout it is.

Deepayan

> [...]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Mar 25 15:34:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST