title: Add number of observations per group in ggplot2 boxplot
body: <p>Following this question: <a href="https://stackoverflow.com/questions/15660829">How to add a number of observations per group and use group mean in ggplot2 boxplot?</a>, I want to add number of observations per group in ggplot boxplot too. But I have added a colour into aes mapping.  </p>
  
  <p>The existing answer shows how to adjust text position in y axis. How could I adjust the text position in the x axis?</p>
  
  <p>This is a minimum example to reproduce my problem:</p>
  
  <pre><code>library(ggplot2)
  
  give.n &lt;- function(x){
    return(c(y = median(x)*1.05, label = length(x))) 
    # experiment with the multiplier to find the perfect position
  }
  
  
  p &lt;- ggplot(mtcars, aes(factor(vs), mpg, colour = factor(am))) + 
      geom_boxplot() +
      stat_summary(fun.data = give.n, geom = "text", fun.y = median)
  p
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/XIFia.png" alt="enter image description here"></p>
  
  <p>Thanks for any suggestions. </p>