Skip to content
Prev 156594 / 398506 Next

Coloring spaces between lines in xyplot

On Thu, Sep 18, 2008 at 5:14 PM, Seth W Bigelow <sbigelow at fs.fed.us> wrote:
Well, if you relax the condition to use lattice, try

install.packages("ggplot2")
library(ggplot2)

x <- rep(seq(1,10), 2)
y <- c(1+1.5*(1:10), 0.2 + 1.3*(1:10) )
trt <- rep(c("low", "high"), each = 10)

qplot(x, y, fill=trt, geom="area")

Hadley