title: R: tailoring legend in ggplot boxplot leaves two separate legends
body: <p>I have created a faceted boxplot using the ggplot2 package. The R code is as follows:</p>
  
  <pre><code>version.labs &lt;- c(`1`="Version 1.0", `2`="Version 2.0", `3`="Version 3.0", `4`="Version 4.0", `5`="Version 5.0")
  ggplot(df, aes(x=factor(Subsystem), y=Risk.value, fill=factor(Version)) ) + 
    geom_jitter(position=position_jitter(width=0.3, height=0.2), aes(colour=factor(Version)), alpha=0.9) +
    geom_boxplot(alpha = 0.5, show.legend = FALSE) + facet_grid(.~Version, labeller = as_labeller(version.labs)) +
    theme(strip.text.x = element_text(size=9, color="black", face="bold"))
  </code></pre>
  
  <p>The resulting plot looks pretty good (as shown below) exept for the legend.</p>
  
  <p><a href="https://i.stack.imgur.com/iAxtC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAxtC.png" alt="enter image description here"></a></p>
  
  <p>In the legend I want to change the title as well as the text label for each item. The title should be "Version" and the labels "Version 1.0", ..., "Version 5.0".</p>
  
  <p>I've tried various ways but they all add a new separate legend. The new legend looks good, but the old one is still there which doesn't look good and I can't find a way to remove it.</p>
  
  <p>The last thing I tried was to add the scale_color_manual() function, like this:</p>
  
  <pre><code>scale_color_manual(name = "Version", labels=c("v1.0","v2.0","v3.0","v4.0","v5.0"), values=c("grey","blue","green","red","black"))
  </code></pre>
  
  <p>This results in a boxplot that looks like this.</p>
  
  <p><a href="https://i.stack.imgur.com/7GF7g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7GF7g.png" alt="enter image description here"></a></p>
  
  <p>As can be seen there are two legends. So, close but no cigar. Any hints on how to solve this are appreciated.</p>