With a data frame df
and a column col_name
I generate histograms like below.
ggplot(df, aes_string(x=col_name)) +
geom_histogram(aes(y=..density..),
binwidth=1,
colour="black", fill="white")
This gives me a histogram like below. I need to change two things in this.
- display the density values at the top inside each bar
- change the density value to percentage - instead of 0.4 , show 40%