Skip to content
Prev 82656 / 398506 Next

superimpose density line over hist

Le 13.12.2005 14:23, Albert Vilella a ??crit :
Hi Albert,

A few comments :
- your code should be reproductible, otherwise it is useless. (that 
recommandation is on the posting guide)

- that question is a top ten question on that list, go to the archive 
and you will find answers. (also posting guide)
BTW, it should be a FAQ and what about an example of overlaying in hist 
help page ?

- then if you want to superimpose an histogram and a density curve, they 
should be on the same scale, it is not the case since you missed the 
argument freq in your hist call, it should be :

R> hist(alnlength, freq=FALSE)

- Why do you simulate points to draw the density line ? Give a shot at :

R> curve(dchisq, df=4, col="red")


- That might interrest you :
http://addictedtor.free.fr/graphiques/search.php?q=hist

Romain