For layouting reasons I would like to position the histgram bars centered on the labels, such that the middle of a bar is on top of the label.
library(ggplot2)
df <- data.frame(x = c(0,0,1,2,2,2))
ggplot(df,aes(x)) +
geom_histogram(binwidth=1) +
scale_x_continuous(breaks=0:2)
This is what it looks so far - the left side of a bar is on top of the label:
Is it possible to adjust the given snippet in such a way? (without using geom_bar instead f.x.)