[R] shading under the lines in a lattice xyplot?

From: Andy Bunn <abunn_at_whrc.org>
Date: Thu 16 Feb 2006 - 04:28:17 EST


In the lattice plot below I want to fill-in the areas under each lines that are greater than zero in gray. Is there a straightforward way to go about this? Thanks, Andy

library(lattice)
foo <- data.frame(Yrs=rep(1:50,4), Y=rnorm(200),

                  Id=unlist(lapply(letters[1:4],rep,50)))
xyplot(Y~Yrs|Id, data = foo,
       panel = function(x,y) {
          panel.abline(h=0)
          panel.lines(x,y, col = "black")
       })

______________________________________________
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 Thu Feb 16 04:33:52 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:31 EST