title: Boxplot, how to match outliers' color to fill aesthetics?
body: <p>I am trying to match boxplot's outliers color to the fill color which is set by aesthetic (scale_colour_discrete).</p>
  
  <p>Here is an example.</p>
  
  <pre><code>m &lt;- ggplot(movies, aes(y = votes, x = factor(round(rating)),
      fill=factor(Animation)))
  m + geom_boxplot() + scale_y_log10()
  </code></pre>
  
  <p>This generates plot below. How do I change those black dots to be reddish/greenish colors used in the body?  outlier.colour option of the boxplot seems to pick one colour across, and not as aesthetic, if I understand correctly.  I dont mind using colour aesthetics if that helps.</p>
  
  <p><img src="https://i.stack.imgur.com/6crNw.png" alt="Original Version">  </p>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>Adapted <a href="https://stackoverflow.com/questions/4765482/changing-whisker-definition-in-geom-boxplot">this solution (Changing whisker definition in geom_boxplot)</a>.  The horizontal dodging is reset by stats_summary and I couldn't figure out how to get it back.  I'd ptobably drop outliers and stretch whiskers as needed since I know how now.</p>
  
  <pre><code># define the summary function
  f &lt;- function(x) {
    r &lt;- quantile(x, probs = c(0.05, 0.25, 0.5, 0.75, 0.95))
    names(r) &lt;- c("ymin", "lower", "middle", "upper", "ymax")
    r
  }
  # define outlier function, beyound 5 and 95% percentiles
  o &lt;- function(x) {
    subset(x, x &lt; quantile(x,probs=c(0.05))[1] | quantile(x,probs=c(0.95))[1] &lt; x)
  }
  
  m &lt;- ggplot(movies, aes(y = votes, x = factor(round(rating)),
      colour=factor(Animation)))
  m &lt;- m + stat_summary(fun.data=f, geom='boxplot')
  m &lt;- m + stat_summary(fun.y=o, geom='point', aes(colour=factor(Animation)))
  m + scale_y_log10()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6jlts.png" alt="Failed attempt"></p>