[R] ggplot 2: Histogram with bell curve?

wwreith reith_william at bah.com
Tue Jun 7 19:59:35 CEST 2011


I am learning ggplot2 commands specifically qplot for the time being and I
have figured out how to create histograms and normal density curves but I am
not sure how to add a normal bell curve or other dist. as well 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/ggplot-2-Histogram-with-bell-curve-tp3580359p3580359.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list