On Mar 13, 2007, at 12:19 AM, Nguyen Dinh Nguyen wrote: > Dear R helpers, > I have a graph as following; I would like to highlight the > overlapping area > between the two curves. Do you know how to do this? > Thank you in advance for your help.
Perhaps not exactly what you wanted, but it might give you some ideas: p <- seq(0.2,1.4,0.01) x1 <- dnorm(p, 0.70, 0.12) x2 <- dnorm(p, 0.90, 0.12) plot(range(p), range(x1,x2), type="n") lines(p, x1, col = "red",lwd=4, lty=2) lines(p, x2, col = "blue",lwd=4) polygon(c(p,p[1]),c(pmin(x1,x2),0), col="grey") > Nguyen Haris Skiadas Department of Mathematics and Computer Science Hanover College ______________________________________________ [email protected] 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.
