I really want to get the legend into the histogram. And I can't figure out what's going on here.
ggplot(data=Male, aes(Male$Naval.Girth)) +
geom_histogram(aes(y =..density..),
breaks=seq(63, 123, by = 3),
col="black",
fill="black",
alpha=.7) +
labs(title="Male Naval Girth Measurements",
x= "Girth (cm)", y="Density") +
geom_vline(aes(xintercept=mean(Male$Naval.Girth, na.rm=T)), show.legend = TRUE,
color="red", linetype="dashed", size=1.2) +
stat_function(fun=dnorm,
color="red",
size = 0.7,
args=list(mean=mean(Male$Naval.Girth),
sd=sd(Male$Naval.Girth)))
Thanks.