[R] plotting question: filling area between two lines

2003-02-25 Thread Christof Bigler
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

2003-02-25 Thread Achim Zeileis
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