
Dear all

I have two questions regarding trellis plots - which I hope you may be able to help me with.

Is it possible to place the key in a trellis plot on the panel (instead of beside the panel)? This will cause the same key to be reproduced on each panel. Please see the plot below - here I placed the legend below the plot. I tried moving the key to the function statement, but it did not really work out the way I expected.

One last thing, in the plot below I placed a horizontal line on the plot, is it possible to only have the horizontal line on the left panel (I remember that in S it was possible to state something like "if(get("cell",fr=9)==2)" in the function statement to include the line on only one of the panels)?

All suggestions will highly appreciated.

Br Henrik



###############################

data           <- as.data.frame(cbind(rep(1:4,each=25),
                  rep(1:2,each=50) ,rep(1:25,4),
                  rnorm(100,0,1) ))
names(data)   <- c("ID","DOSE","TIME","DV")



xyplot(DV~TIME | DOSE, data=data, groups=ID, layout=c(2,1),

       key=list(space="bottom",border=TRUE,colums=2,text=list(c("ID1","ID2"),col=c(1,4)),
              lines=list(type="o",pch=c(1,16),lty=c(1,2), col=c(1,4)),
              layout.heights=list(key.axis.padding=15)),
           
       panel = function(x,y,groups,...) {
                 panel.superpose.2(x,y,groups,...,type="o",pch=c(1,16),
                 lty=c(1,2), col=c(1,4), cex=0.8)
                 panel.abline(h=0.301,col=5,lty=1,lwd=2)  
    }
)

###############################





	[[alternative HTML version deleted]]

