[R] Histogram frequencies with a normal pdf curve overlay

Jacques Wagnor jacques.wagnor at gmail.com
Sat May 9 18:10:42 CEST 2009

Dear List,

When I plot a histogram with 'freq=FALSE' and overlay the histogram
with a normal pdf curve, everything looks as expected, as follows:

x <- rnorm(1000)
hist(x, freq=FALSE)
curve(dnorm(x), add=TRUE, col="blue")

What do I need to do if I want to show the frequencies (freq=TRUE)
with the same normal pdf overlay, so that the plot would still look
the same?



platform       i386-pc-mingw32
arch           i386
os             mingw32
system         i386, mingw32
major          2
minor          8.0
year           2008
month          10
day            20
svn rev        46754
language       R
version.string R version 2.8.0 (2008-10-20)

More information about the R-help mailing list