Re: [R] superimpose density line over hist

From: Romain Francois <francoisromain_at_free.fr>
Date: Wed 14 Dec 2005 - 01:40:59 EST

Le 13.12.2005 14:23, Albert Vilella a écrit :

>Hi all,
>
>I'm trying to superimpose a rchisq density line over a histogram with
>something like:
>
>hist(alnlength)
>lines(density(rchisq(length(alnlength), 4)),col="red")
>
>But the rchisq line won't appear anywhere,
>
>Anyone knows what I am missing here?
>
>Thanks in advance,
>
> Albert.
>
>
Hi Albert,

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

R> hist(alnlength, freq=FALSE)

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

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
R-help@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
Received on Wed Dec 14 02:32:58 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:35 EST