highlight an area below a line

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

highlight an area below a line

Georg Otto
Hi,

if I plot a normal distribution like this:

d<-density(rnorm(10000))
plot(d)

how can I highlight the area below the graph in a certain interval,
say x=1,2?  I understand that I should use polygon, but I have not
found the right way to give the result that I want.

Thanks a lot!

Georg

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html