title: How to rotate matplotlib annotation to match a line?
body: <p>Have a plot with several diagonal lines with different slopes. I would like to annotate these lines with a text label that matches the slope of the lines.</p>
  <p>Something like this:</p>
  <p><img src="https://i.stack.imgur.com/d9bG0.png" alt="Annotated line" /></p>
  <p>Is there a robust way to do this?</p>
  <p>I've tried both <code>text</code>'s and <code>annotate</code>'s rotation parameters, but those are in screen coordinates, not data coordinates (i.e. it's always <code>x</code> degrees on the screen no matter the xy ranges). My <code>x</code> and <code>y</code> ranges differ by orders of magnitude, and obviously the apparent slope is affected by viewport size among other variables, so a fixed-degree rotation doesn't do the trick. Any other ideas?</p>