[R] shade between two curves

David Bickel davidbickel.com+rhelp at gmail.com
Fri Feb 4 13:55:58 CET 2011


Is there a function that can shade the region between two arbitrary
curves? For example, how can I fill in the area between these two
plotted curves?

> x <- 1:10
> y <- x + rnorm(10)
> z <- x + 10 + rnorm(10)
> plot(x, y, type = "l", ylim = c(0,20))
> lines(x, z)

I would appreciate any help.

David



More information about the R-help mailing list