title: geom_density to match geom_histogram binwitdh
body: <p>I would like to add a line to a distribution bar plot in ggplot2 to show the average distribution but am having trouble. </p>
  
  <p>A ggplot call like this:</p>
  
  <pre><code>ggplot(x, aes(date_received)) + 
      geom_histogram(aes(y = ..count..), binwidth=30) +
      geom_density()
  </code></pre>
  
  <p>gives me the histogram bars for every 30 days worth of observations, but the density line is tracking the count for every individual day, as seen below (the static at the bottom is from <code>geom_density</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/KDKC0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KDKC0.png" alt="enter image description here"></a></p>
  
  <p>Is it possible to add a <code>geom_density</code> layer to overlay a line that will show the average for the count of 30 day groups of observations like the <code>binwidth</code> in <code>geom_histogram</code>.</p>
  
  <p>Any help is appreciated.</p>