title: ggplot2: Boxplots with points and fill separation
body: <p>I have a data which can be divaded via two seperators. One is year and second is a field characteristics.</p>
  <pre><code>box&lt;-as.data.frame(1:36)
  
  box$year &lt;- c(1996,1996,1996,1996,1996,1996,1996,1996,1996,
                1997,1997,1997,1997,1997,1997,1997,1997,1997,
                1996,1996,1996,1996,1996,1996,1996,1996,1996,
                1997,1997,1997,1997,1997,1997,1997,1997,1997)
  box$year &lt;- as.character(box$year)
  
  box$case &lt;- c(6.40,6.75,6.11,6.33,5.50,5.40,5.83,4.57,5.80,
                6.00,6.11,6.40,7.00,NA,5.44,6.00,  NA,6.00,
                6.00,6.20,6.40,6.64,6.33,6.60,7.14,6.89,7.10,
                6.73,6.27,6.64,6.41,6.42,6.17,6.05,5.89,5.82)
  
  box$code &lt;- c(&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,
                &quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,
                &quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;,&quot;M&quot;)
  
  colour &lt;- factor(box$code, labels = c(&quot;#F8766D&quot;, &quot;#00BFC4&quot;))
  </code></pre>
  <p>In boxplots, I want to display points over them, to see how data is distributed. That is easily done with one single boxplot for every year:</p>
  <pre><code>ggplot(box, aes(x = year, y = case, fill = &quot;#F8766D&quot;)) +
    geom_boxplot(alpha = 0.80) +
    geom_point(colour = colour, size = 5) +
    theme(text = element_text(size = 18),
          axis.title.x = element_blank(),
          axis.title.y = element_blank(),
          panel.grid.minor.x = element_blank(),
          panel.grid.major.x = element_blank(),
          legend.position = &quot;none&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/mKWnr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mKWnr.png" alt="enter image description here" /></a></p>
  <p>But it become more complicated as I add fill parameter in them:</p>
  <pre><code>ggplot(box, aes(x = year, y = case, fill = code)) +
    geom_boxplot(alpha = 0.80) +
    geom_point(colour = colour, size = 5) +
    theme(text = element_text(size = 18),
          axis.title.x = element_blank(),
          axis.title.y = element_blank(),
          panel.grid.minor.x = element_blank(),
          panel.grid.major.x = element_blank(),
          legend.position = &quot;none&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/NnSwK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NnSwK.png" alt="enter image description here" /></a></p>
  <p>And now the question: How to move these points to boxplot axes, where they belong? As blue points to blue boxplot and red to red one.</p>