title: Align bars of histogram centered on labels
body: <p>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.</p>
  
  <pre><code>library(ggplot2)
  
  df &lt;- data.frame(x = c(0,0,1,2,2,2))
  
  ggplot(df,aes(x)) + 
      geom_histogram(binwidth=1) + 
      scale_x_continuous(breaks=0:2)
  </code></pre>
  
  <p>This is what it looks so far - the left side of a bar is on top of the label:</p>
  
  <p><img src="https://i.stack.imgur.com/kQx6v.png" alt="enter image description here"></p>
  
  <p>Is it possible to adjust the given snippet in such a way? (without using geom_bar instead f.x.)</p>