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

Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com
Thu Sep 13 15:27:53 CEST 2007


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.



More information about the R-help mailing list