Re: [R] adding labels to a multiple plot in lattice

From: Deepayan Sarkar <>
Date: Sun 11 Sep 2005 - 06:54:50 EST

On 9/9/05, Jorge Ahumada <> wrote:
> Hello,
> I am trying to a create a plot in lattice that has four panels, but
> all of them have the same xlab and ylab, so instead of labeling each
> plot separately I want to create one single label for the y series
> and one for the x series, somehow along the left and bottom margins
> of the plot. Can anybody help? This is the pseudocode:
> print(xyplot(x1~y1),split=c(1,1,2,2),more=T)
> print(xyplot(x2~y2),split=c(2,1,2,2),more=T)
> print(xyplot(x3~y3),split=c(1,2,2,2),more=T)
> print(xyplot(x4~y4),split=c(2,2,2,2))

The obvious thing to do would be

a <- factor(rep(1:4, c(length(x1), length(x2), length(x3), length(x4)))) xyplot(c(x1, x2, x3, x4) ~ c(y1, y2, y3, y4) | a,

       scales = "free", xlab = "whatever")

Deepayan mailing list PLEASE do read the posting guide! Received on Sun Sep 11 07:02:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:09 EST