[R] polygon

mike.campana@freesurf.ch mike.campana at freesurf.ch
Tue Apr 20 10:22:02 CEST 2004

Dear all

In order to clearly mark values wich are larger than a treshold value, I 
would like to color the surface below the line given by plot (yy~xx). To 
color is only the surface between abline (treshold) and yy if they are 
larger than the specific limit. I guess I can use the function polygon, 
but I can not find any valuable solution.
I'm grateful to you for an advice or an example.

xx <- c(1:100)
yy <- rnorm(100)
plot (yy~xx,type="l")
abline (h=0.5,col="red")
#?? how can I use polygon()
#in order to color surface below yy value and > abline??


More information about the R-help mailing list