title: r - How to annotate curves
body: <p>I would like to add a label to each line of a curve plot, at the proper angle, as in the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/YSzVE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YSzVE.png" alt="enter image description here"></a></p>
  
  <p>Here is my humble script:</p>
  
  <pre><code>I0 &lt;- log(1)
  b &lt;- .1
  curve(exp(I0 - b * x), 0, 50, 
        xlab = "No. of Species (R)", ylab = "Rate (I or E)", col = "blue", lwd = 2)
  d &lt;- .01
  curve(exp(d * x) - 1, 0, 50, add = TRUE, col = "orange", lwd = 2)
  
  I0 &lt;- log(1/2)
  curve(exp(I0 - b * x), 0, 50, add = TRUE, lty = 2, col = "green", lwd = 2)
  d &lt;- .014
  curve(exp(d * x) - 1, 0, 50, add = TRUE, lty = 2, col = "red", lwd = 2)
  
  title(main = "The equilibrium model of island biogeography")
  </code></pre>
  
  <p>This script generates the plot shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/VcH3Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VcH3Q.png" alt="enter image description here"></a></p>
  
  <p>I attempted to follow the suggestions from <a href="https://stackoverflow.com/questions/11767484/how-to-annotate-a-reference-line-at-the-same-angle-as-the-reference-line-itself#">here</a>, but could not figure out how to do it with my plot.</p>
  
  <p>Any hints?</p>