title: ggplot: How to change boxplot settings when stat_summary is used
body: <p>I would like to have grouped boxplots which whiskers is defined by stat_summary. With help of <a href="https://stackoverflow.com/questions/4765482/changing-whisker-definition-in-geom-boxplot">changing-whisker-definition</a> I wrote the following code:</p>
  
  <pre><code># Data
  xdf2 &lt;- data.frame(month = rep(1:6,each=100)
                    , grp = rep(c('A','B'), 50*6)
                    )
  xdf2$m &lt;- rpois(n=nrow(xdf2),10)
  # Definition of whiskers
  f &lt;- function(x) {
    r &lt;- quantile(x, probs = c(0.10, 0.25, 0.5, 0.75, 0.90))
    names(r) &lt;- c("ymin", "lower", "middle", "upper", "ymax")
    r
  }
  
  # Add points outside of whiskers
  o &lt;- function(x) {
    subset(x, x &lt; quantile(x,probs=0.1) | quantile(x,probs=0.9) &lt; x)
  }
  
  
  # Plot
  ggplot(data = xdf2
           , aes(factor(month),m, color=grp)
           ) +
         stat_summary(fun.data = f
                      , geom="boxplot"
                      , position=position_dodge(width=1)
                      , size=1
                      ) +
          stat_summary(fun.y = o, geom="point", position=position_dodge(width=1)) +
          scale_color_manual(values = c("gray30","darkgrey"),labels = c("AAA","BBB")) +
          theme_bw()
  </code></pre>
  
  <p>which gives the following graphs:
  <img src="https://i.stack.imgur.com/ZUlpl.jpg" alt="enter image description here"></p>
  
  <p>There are some changes I would like to perform:   </p>
  
  <ul>
  <li>How can I change the width of the boxes?</li>
  <li>How can I fill the boxes with the same color of the border?</li>
  </ul>
  
  <p>I would be happy for any help. Thanks a lot.</p>