This seem like a simple question, but I can't find out the answer anywhere.
Plotting a histogram, and wanting to add the data labels for the bins. This is as far as I have managed to get and the awful looking result (code is fully reproducible):
df=data.frame(ToothGrowth)
require(ggplot2)
ggplot(data=df, aes(x=len, y=..count.., label=..count..))+
geom_histogram(binwidth=5, aes(fill=..count..))+
geom_text(stat="bin", vjust=-1)
The resulting chart:
How do I fix the data labels so that they are:
1) Showing up above each of the bins?
2) Showing the counts for the bins?