[R] How to fill the aerea under a plot?

Ananke ananke at hotbot.com
Wed Jun 2 19:23:40 CEST 1999

Dear R users,

I hope that this question is not too dumb,
but I can't figure out how to do it.

I plot a function, e.g.
plot(sin, -pi, 2*pi).

Then I would like to have the aerea
from the x-axis up to the graph
from x ranging from -3 to 0, shaded
red and the other part (x from 0 to 6) under 
the graph e.g. green or sth. like that..

Any hints on how to do that?
I could draw lines (different line-styles),
but can't I simply fill these two aereas
in e.g. different colors?

thanks a lot for the help,

HotBot - Search smarter.
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list