ggplot(birthData, aes(x = births)) +
geom_histogram(aes(y = ..density.., fill = ..count..), bins = 25) +
scale_fill_gradient('Count', low = '#DCDCDC', high = '#7C7C7C') +
stat_function(fun = dnorm, color='red',
args = list(mean = mean(birthData$births),
sd = sd(birthData$births)),
show.legend = FALSE,
aes(size = 2)) +
theme(legend.position = 'none') +
scale_y_continuous('Proportion', labels = scales::comma) +
scale_x_continuous('Births', labels = scales::comma) +
labs(title = 'Frequency of Births in Single Day (1969-1988)',
caption = 'Data From: http://vincentarelbundock.github.io/Rdatasets/')
ggplot(birthData, aes(x=births)) + geom_histogram(aes(y=..density.., fill=..count..), bins=25) + scale_fill_gradient('Count', low='#DCDCDC', high='#7C7C7C') +
stat_function(fun=dnorm, color='red', args=list(mean=mean(birthData$births), sd=sd(birthData$births)), aes(size=2), show.legend=FALSE) +
theme(legend.position='none') +
scale_y_continuous('Proportion', labels=scales::comma) + scale_x_continuous('Births', labels=scales::comma) +
labs(title='Frequency of Births in Single Day (1969-1988)', caption='Data From: http://vincentarelbundock.github.io/Rdatasets/')