I am learning ggplot2 commands and I have figured out how to create
histograms and density curves but I am not sure how to add a density curve
on top of a histogram.
Here are the two graphs that I created.
## Histogram
t<-rnorm(500)
w<-qplot(t, main="Normal Random Sample", fill=I("blue"), colour=I("black"),
geom="histogram")
w
##Density Curve
t<-rnorm(500)
r<-qplot(t, main="Normal Random Sample", colour=I("black"), geom="density",
adjust=4)
r
--
View this message in context:
http://r.789695.n4.nabble.com/ggplot2-Histogram-with-density-curve-tp3579894p3579894.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.