Christof Bigler
2003-Feb-25 17:52 UTC
[R] plotting question: filling area between two lines
Is there any way to fill the area within a plotted line and a horizontal line, e.g. in the following example: x <- rnorm(100) plot(x,type="l") abline(h=0) Thanks for any help. Christof
On Tuesday 25 February 2003 17:51, Christof Bigler wrote:> Is there any way to fill the area within a plotted line and a > horizontal line, e.g. in the following example: > > x <- rnorm(100) > plot(x,type="l") > abline(h=0)You could do polygon(c(1, 1:100, 100), c(0, x, 0), col = "grey") in the above example. Z> Thanks for any help. > > Christof > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help