title: How to annotate the line at ggplot?
body: <p>I want to annotate each line with factor variable (chain.length) like shown on the picture. How would I do it?</p>
  
  <p><img src="https://i.stack.imgur.com/UId4S.png" alt="ggplot"></p>
  
  <p>Here is the code for picture above.</p>
  
  <pre><code>  ggplot(mz_rt, aes(rt, mz, size = acex, colour = as.factor(double.bonds))) +
    geom_line(aes(group = as.factor(chain.len)), colour = "grey", size = 0.3) +
    geom_point() +
    scale_radius(breaks = seq(from = 0, to = 1, by = 0.2)) +
    theme(legend.position="bottom") +
    theme_light()
  </code></pre>