Skip to content

plotting the lognormal density curve

2 messages · Garrett Gman, Henrik Bengtsson

#
I am trying to plot a lognormal density curve on top of an existing
histogram. Can anybody suggest a simple way to do this? Even if someone
could just explain how to plot a regular normal density curve on top of an
existing histogram, it would be a big help.

Also, is there some way to search through the R-help archives other than
simple browsing?

Thank you so much. Your help and time is greatly appreciated.
#
For the normal distribution

N <- 1000
xSamples <- rnorm(N, mean=0, sd=1)
hist(xSamples, freq=FALSE)
curve(dnorm(x, mean=0, sd=1), add=TRUE)

Similar for log normal; dlnorm() & friends.

Cheers

Henrik Bengtsson