[R] how to plot shaded area under a curve?

AA aa2007r at gmail.com
Thu Sep 13 17:35:31 CEST 2007


in addition to Charles' suggestion which is more advanced, I found the link 
below very helpful.
http://www.feferraz.net/en/shaded.html
good luck
AA.

----- Original Message ----- 
From: "Charles Annis, P.E." <Charles.Annis at StatisticalEngineering.com>
To: "'gallon li'" <gallon.li at gmail.com>; "'r-help'" 
<r-help at stat.math.ethz.ch>
Sent: Thursday, September 13, 2007 9:27 AM
Subject: Re: [R] how to plot shaded area under a curve?


> While it's true that polygon() is the function you need, perhaps it would 
> be
> helpful to see an example of how to use polygon().
>
> Go here: http://addictedtor.free.fr/graphiques/thumbs.php
>
> Put the mouse over the thumbnail plots to see larger pictures and look for
> something useful.  You will find it here:
> http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=88
>
> The code for this graph is downloadable too.  Just click on the icon on 
> the
> left of the screen.
>
> Best wishes!
>
> Charles Annis, P.E.
>
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax:  614-455-3265
> http://www.StatisticalEngineering.com
>
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] 
> On
> Behalf Of gallon li
> Sent: Thursday, September 13, 2007 6:52 AM
> To: r-help
> Subject: [R] how to plot shaded area under a curve?
>
> say, I am plotting
>
> x=seq(0,5,len=100)
> y=-(x-5)^2
>
> plot(x,y)
>
> how can I put some color or verticle lines below the plotted curve?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list