Re: [R] shade between two curves

2011-02-04 Thread Dirk Eddelbuettel
On 4 February 2011 at 07:55, David Bickel wrote: | 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"

Re: [R] shade between two curves

2011-02-04 Thread Sarah Goslee
polygon() will do it. That's a frequently-discussed topic on this list, so there are plenty of examples in the archives, and also some on the R Graph Gallery. Sarah On Fri, Feb 4, 2011 at 8:03 AM, David Bickel wrote: > Is there a function that can shade the region between two arbitrary > curves?

[R] shade between two curves

2011-02-04 Thread David Bickel
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 lines? > 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. Davi

[R] shade between two curves

2011-02-04 Thread David Bickel
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. Dav

[R] shade between two curves

2011-02-04 Thread David Bickel
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. Dav