Re: [R] How to color certain area under curve

2009-03-13 Thread Vincent Goulet
I did similar things with polygon(). Le mar. 10 mars à 13:30, g...@ucalgary.ca a écrit : For a given random variable rv, for instance, rv = rnorm(1000), I plot its density curve and calculate some quantiles: plot(density(rv)) P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) I would like to

[R] How to color certain area under curve

2009-03-10 Thread guox
For a given random variable rv, for instance, rv = rnorm(1000), I plot its density curve and calculate some quantiles: plot(density(rv)) P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) I would like to color the area between P10 and P90 and under the curve and mark the P50 on the curve. rv =

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
guox at ucalgary.ca writes: For a given random variable rv, for instance, rv = rnorm(1000), I plot its density curve and calculate some quantiles: plot(density(rv)) P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) I would like to color the area between P10 and P90 and under the curve

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
Just a small typo. I forgot a ) in the polygon function. The code must be: polygon(x = c(qrv[1], drv$x[select], qrv[2]), y = c(0, drv$y[select], 0), col='blue') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE