Message-ID: <20050427200749.23bf47fc.Achim.Zeileis@wu-wien.ac.at>
Date: 2005-04-27T18:07:49Z
From: Achim Zeileis
Subject: Density curve over a histogram
In-Reply-To: <6ade6f6c05042711065f69746b@mail.gmail.com>
On Wed, 27 Apr 2005 19:06:07 +0100 Paul Smith wrote:
> Dear All
>
> I would like to draw a picture with the density curve of a normal
> distribution over a histogram of a set of random numbers extracted
> from the same normal distribution. Is that possible?
To quote Simon `Yoda' Blomberg: "This is R. There is no if. Only how."
(see fortune("Yoda"))
Try:
R> x <- rnorm(100)
R> hist(x, freq = FALSE)
R> curve(dnorm, col = 2, add = TRUE)
Z
> Thanks in advance,
>
> Paul
>
> ______________________________________________
> 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
>