[R] Re :adding a line to a single panel of a lattice plot

Ken Knoblauch knoblauch at lyon.inserm.fr
Mon May 17 11:01:14 CEST 2004


OK, I've found the solution myself adapted from the example on p. 101 
of V&R MASS, 4th edition.  This works as I would like it to, plotting 
an abline on a single panel:

xyplot(y ~ x | z, data = my.df, subscripts=TRUE, ID=my.df$z,
  panel=function(x,y) {
    panel.xyplot(x,y)
    panel.lmline(x,y)
    which = unique(ID[subscripts])
   if (which==1) panel.abline(c(0.25,0.79),lty=2) 
  },
       layout=c(3,1),aspect="x",
       scales=list(cex=1.2),
       xlab=list(label="x"),
       ylab=list(label="y")

I needed to explore one more source to find the solution. Sorry to
have bothered the help precociously.

____________________
Ken Knoblauch
Inserm U 371
Cerveau et Vision
18 avenue du Doyen Lepine
69675 Bron cedex
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: 06 84 10 64 10


____________________
Ken Knoblauch
Inserm U 371
Cerveau et Vision
18 avenue du Doyen Lepine
69675 Bron cedex
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: 06 84 10 64 10




More information about the R-help mailing list