Skip to content

Instantly share code, notes, and snippets.

@alejio
Last active August 29, 2015 14:26
Show Gist options
  • Save alejio/a8e969b6175c06aa9bcf to your computer and use it in GitHub Desktop.
Save alejio/a8e969b6175c06aa9bcf to your computer and use it in GitHub Desktop.
R: ggplot2 histogram with density
#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)
@alejio
Copy link
Author

alejio commented Aug 1, 2015

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment