title: Median and quartile on advanced violin plots in ggplot2
body: <p>This question is for an extension of the answer to the question posed here: <a href="https://stackoverflow.com/questions/17319487/median-and-quartile-on-violin-plots-in-ggplot2">Median and quartile on violin plots in ggplot2</a>.</p>
  
  <p>The solution works beautifully, but how would it be extended to also take the position of the violin plots into account when using options such as fill='foo'</p>
  
  <p>Example:</p>
  
  <pre><code>require(ggplot2)
  
  median.quartile &lt;- function(x){
    out &lt;- quantile(x, probs = c(0.25,0.5,0.75))
    names(out) &lt;- c("ymin","y","ymax")
    return(out) 
  }
  
  ggplot(data=mtcars,aes(x=factor(cyl),y=drat, fill=factor(am)))+
      geom_violin() +
      stat_summary(fun.y=median.quartile,geom='point')
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/MBH9I.png" alt="Violin plot with summary"></p>
  
  <p>Here the summary statistics get mixed because it does not take displacement due to fill asteric mapping into account.</p>
  
  <p>Can this be fixed?</p>
  
  <p>In advance - Thanks!</p>