title: Label the midpoint of a segment in ggplot
body: <p>In the plot below I'd like to label the arrows with the text in <code>bar$lbl</code>. I'd like to do so in a way that would keep any labels from overlapping (they wouldn't in the simple example below). I'd prefer not to calculate the label position by hand. </p>
  
  <p>I'm familiar with getting pretty, non-overlapping labels on points with <code>ggrepel</code> and curious if there is a similar way to label the midpoints of segments? </p>
  
  <p>Any advice appreciated. </p>
  
  <pre><code>library(ggplot2)
  foo &lt;- data.frame(x=runif(50),y=runif(50))
  bar &lt;- data.frame(x1=c(0.2,0),x2=c(0.7,0.2),
                    y1=c(0.1,0.9),y2=c(0.6,0.5),
                    lbl=c("Arrow 1", "Arrow 2"))
  p1 &lt;- ggplot(data=foo,aes(x=x,y=y))
  p1 &lt;- p1 + geom_point(color="grey")
  p1 &lt;- p1 + geom_segment(data=bar,aes(x=x1, xend=x2, y=y1, yend=y2), 
                          size = 0.75,arrow = arrow(length = unit(0.5, "cm")))
  p1
  </code></pre>