title: Fill superimposed ellipses in ggplot2 scatterplots
body: <p>This question is a follow-up of "<a href="https://stackoverflow.com/questions/2397097/how-can-a-data-ellipse-be-superimposed-on-a-ggplot2-scatterplot">How can a data ellipse be superimposed on a ggplot2 scatterplot?</a>".</p>
  
  <p>I want to create a 2D scatterplot using <code>ggplot2</code> with <em>filled</em> superimposed confidence ellipses. Using the solution of Etienne Low-Décarie from the above mentioned post, I do get superimposed ellipses to work. The solution is based on <code>stat_ellipse</code> available from <a href="https://github.com/JoFrhwld/FAAV/blob/master/r/stat-ellipse.R" rel="nofollow noreferrer">https://github.com/JoFrhwld/FAAV/blob/master/r/stat-ellipse.R</a></p>
  
  <p><strong>Q:</strong> How can I fill the inner area of the ellipse(s) with a certain color (more specifically I want to use the color of the ellipse border with some alpha)?</p>
  
  <p>Here is the minimal working example modified from the above mentioned post:</p>
  
  <pre><code># create data
  set.seed(20130226)
  n &lt;- 200
  x1 &lt;- rnorm(n, mean = 2)
  y1 &lt;- 1.5 + 0.4 * x1 + rnorm(n)
  x2 &lt;- rnorm(n, mean = -1)
  y2 &lt;- 3.5 - 1.2 * x2 + rnorm(n)
  class &lt;- rep(c("A", "B"), each = n)
  df &lt;- data.frame(x = c(x1, x2), y = c(y1, y2), colour = class)
  
  # get code for "stat_ellipse"
  library(devtools)
  library(ggplot2)
  source_url("https://raw.github.com/JoFrhwld/FAAV/master/r/stat-ellipse.R")
  
  # scatterplot with confidence ellipses (but inner ellipse areas are not filled)
  qplot(data = df, x = x, y = y, colour = class) + stat_ellipse()
  </code></pre>
  
  <p>Output of working example:
  <img src="https://i.imgur.com/Rk6KbSD.png" alt="image of example output"></p>