[R] Multiple density plots on 1 graph

Remington, Richard rnews at kernstat.com
Wed Sep 21 21:19:47 CEST 2005


plot( density( rnorm(n=20)), xlim=c(-5,5), ylim=c(0,1))
for( i in 2:50) lines( density( rnorm(n=20)))

emma hartnett wrote:
> I want to overlay 50 denisty plots on a single plot. 
> For each plot there are 10,000 data points and i want
> the empirical density of the data. I have not been
> able to find an easy way to achieve this (I have
> scoured the manula and website so sorry if I missed
> it!), does anyone have any suggestions?
> 
> Thankyou.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 


-- 

Richard E. Remington
Statistician
KERN Statistical Services, Inc.
PO Box 1046
Boise, ID 83701
Tel: 208.426.0113
KernStat.com




More information about the R-help mailing list