title: How to plot a contour line showing where 95% of values fall within, in R and in ggplot2
body: <p>Say we have:</p>
  
  <pre><code>x &lt;- rnorm(1000)
  y &lt;- rnorm(1000)
  </code></pre>
  
  <p>How do I use ggplot2 to produce a plot containing the two following geoms:</p>
  
  <ol>
  <li>The bivariate expectation of the two series of values</li>
  <li>A contour line showing where 95% of the estimates fall within?</li>
  </ol>
  
  <p>I know how to do the first part:</p>
  
  <pre><code> df &lt;- data.frame(x=x, y=y)
   p &lt;- ggplot(df, aes(x=x, y=y))
   p &lt;- p + xlim(-10, 10) + ylim(-10, 10) # say
   p &lt;- p + geom_point(x=mean(x), y=mean(y))
  </code></pre>
  
  <p>And I also know about the stat_contour() and stat_density2d() functions within ggplot2.  </p>
  
  <p>And I  also know that there are 'bins' options within stat_contour. </p>
  
  <p>However, I guess what I need is something like the probs argument within quantile, but over two dimensions rather than one. </p>
  
  <p>I have also seen a solution within the graphics package. However, I would like to do this within ggplot. </p>
  
  <p>Help much appreciated,</p>
  
  <p>Jon</p>