Last active
August 29, 2015 14:26
-
-
Save alejio/a8e969b6175c06aa9bcf to your computer and use it in GitHub Desktop.
R: ggplot2 histogram with density
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Adjusted from http://www.r-bloggers.com/how-to-make-a-histogram-with-ggplot2/ | |
ggplot(data=data1, aes(x=`BOTTLE QTY`)) + | |
geom_histogram(aes(y =..density..), | |
col="red", | |
fill="green", | |
alpha = .2, origin = -0.5, binwidth=1) + | |
labs(title="Histogram for Bottle Quantities") + | |
labs(x="Bottles", y="Count") + scale_x_continuous(limits=c(0,30), breaks=0:30) |
Author
alejio
commented
Aug 1, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment