title: How to interpret the different ggplot2 densities?
body: <p>I am confused about the meaning of the following variants of <code>geom_density</code> in ggplot:</p>
  
  <p>Can someone please explain the difference between these four calls: </p>
  
  <ol>
  <li><code>geom_density(aes_string(x=myvar))</code> </li>
  <li><code>geom_density(aes_string(x=myvar, y=..density..))</code></li>
  <li><code>geom_density(aes_string(x=myvar, y=..scaled..))</code> </li>
  <li><code>geom_density(aes_string(x=myvar, y=..count../sum(..count..)))</code></li>
  </ol>
  
  <p>My understanding is that:</p>
  
  <ul>
  <li><code>geom_density</code> alone will produce a density whose area under the curve sums to 1</li>
  <li><code>geom_density</code> with <code>..density..</code> basically does the same... ?</li>
  <li>the <code>..count../sum(..count..)</code> will normalize the peak heights to be more like a normalized histogram, ensuring that all the heights sum to 1</li>
  <li>the <code>..count..</code> by itself without the denominator will just multiply each bin by # of items in it</li>
  <li>the <code>..scaled..</code> parameter will make it so the maximum value of the density is 1.</li>
  </ul>
  
  <p>I find <code>..scaled..</code> very counterintuitive and have never seen it used if my interpretation of it is correct so I'd like to ignore that. I am mainly looking for a clarification of the differences between <code>geom_density</code> and a kind of normalized density plot, which I am assuming requires the <code>...count../...</code> argument. thanks.</p>
  
  <p>(Related: <a href="https://stackoverflow.com/questions/15651084/ggplot2-mapping-variable-to-y-and-using-stat-bin">Error with ggplot2 mapping variable to y and using stat=&quot;bin&quot;</a>)</p>