title: How can I draw inline line labels in matplotlib?
body: <p>I have the following graph, consisting of several lines:</p>
  
  <p><img src="https://i.stack.imgur.com/WQg4L.png" alt="Sample line plot"></p>
  
  <p>Now, I would like to label all the lines in the plot. However, using <code>legend()</code> crams all the labels together in a box, which makes the plot somewhat difficult to interpret. What I'd like to to instead is to use inline labels. My ideal output would use labels like the following matplotlib contour plot, but with text labels for lines instead of numbers:</p>
  
  <p><img src="https://i.stack.imgur.com/gqm2t.png" alt="Sample contour plot"></p>
  
  <p>I haven't been able to find out how to do this in the matplotlib documentation. Is there a way to achieve this? If not, what other software could I use to generate this type of plot?</p>