If min and max are two vectors with values on the y-axis and x is a vector of 
the values on the x-axis, then you need.

x <- 1:50
z <- matrix(rnorm(100), ncol = 2)
mini <- apply(z, 1, min)
maxi <- apply(z, 1, max)
plot(x, maxi, ylim = range(c(mini, maxi)), type = "l")
lines(x, mini)
polygon(c(x, rev(x)), c(mini, rev(maxi)), density = 100)

HTH,

Thierry


----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology 
and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

Do not put your faith in what statistics say until you have carefully 
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of 
uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens [EMAIL PROTECTED]
Verzonden: maandag 29 oktober 2007 16:16
Aan: [EMAIL PROTECTED]
Onderwerp: [R] shading of curves with polygon

Hello again

With the poylgon function it's possible to plot shaded areas under a curve.
But somehow it connects the start and the endpoint of a line and fills whats 
between them. I would actually like to set the boarders of the shading by two 
min and max curves, but I failed.

i tried stl like:

polygon(min, max, border=0), where min and max are  my curves plotet by 
plot(max)
lines(min)

thanks for help

marc
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

______________________________________________
R-help@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@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.

Reply via email to