title: Add legend to indicate shapes
body: <p>Need some help with adding legend for shapes used in the plot as described below. The plot is as below -  its a box plot, points for means, error bars for confidence interval.</p>
  
  <p>The resulting plot is as below - <strong>how do I add a legend to this so as to tell that the <code>red circles</code> indicate the <code>mean</code> and the <code>green error bars</code> indicate <code>confidence interval</code>  ?</strong> - like in the image below</p>
  
  <p><strong>Required legend</strong></p>
  
  <p><a href="https://i.stack.imgur.com/O076v.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O076v.jpg" alt="Legend"></a></p>
  
  <p><strong>Plot</strong>
  <a href="https://i.stack.imgur.com/lNPON.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lNPON.jpg" alt="Box plot with mean &amp; ci"></a></p>
  
  <p>The data and code used to generate the above is given below for reference.</p>
  
  <pre><code>df &lt;- data.frame(cbind(mtcars[,1], mtcars[,2])) #mtcars[, 1:2]
  colnames(df) &lt;- c("metric", "group")
  df$group &lt;- factor(df$group)
  
  p1 &lt;- ggplot(data=df, aes(x=group, y=metric ) ) +
    geom_boxplot()
  
  metric_means &lt;- aggregate(df$metric, list(df$group), mean) 
  metric_ci_95 &lt;- aggregate(df$metric, list(df$group), function(x){1.96*sd(x)/sqrt(length(x))})
  metric_mean_ci = data.frame(group=metric_means[,1],mean=metric_means[,2], ci=metric_ci_95[,2])
  
  # plot mean
  p1 &lt;- p1 + geom_point(data=metric_means, aes(x=metric_means[,1], y=metric_means[,2]),
                        colour="red", shape=21, size=2)
  
  #plot confidence interval
  p1 &lt;- p1 + geom_errorbar(data=metric_mean_ci, aes(ymin=mean-ci, ymax=mean+ci, x=group, y=mean),
                           color="green", width=.1)
  
  p1
  </code></pre>
  
  <p>What needs to be added to the above code so as to get the legend that reveal the stat summary that the circle and error bar shapes indicate?</p>