[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 __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] plotting question: filling area between two lines
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 __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help