[R] How to color certain area under curve

Vincent Goulet vincent.goulet at act.ulaval.ca
Fri Mar 13 16:50:59 CET 2009


I did similar things with polygon().

Le mar. 10 mars à 13:30, guox at 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 color the area between P10 and P90 and under the curve
> and mark the P50 on the curve.
>
>> rv = rnorm(1000)
>> plot(density(rv))
>> P10P50P90 = = quantile(rv,probs = c(10,50,90)/100)
>
> Could you please teach me how to do these using R?
> Thanks,
> -james
>
> ______________________________________________
> 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