title: How to set labels in matplotlib.hlines
body: <p>I'm trying to put labels for each line in matplotlib.hlines:</p>
  
  <pre><code>from matplotlib import pyplot as plt
  plt.hlines(y=1, xmin=1, xmax=4, label='somelabel1')
  plt.hlines(y=2, xmin=2, xmax=5, label='somelabel2')
  </code></pre>
  
  <p>I need a plot with two horizintal lines with labels on 'y' axis for each line.
  Instead of it I get a plot without labels, with only coordinates (see the sample image). Is it possible to put lables for each line into the plot? </p>
  
  <p><a href="https://i.stack.imgur.com/lqZ3B.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lqZ3B.png" alt="enter image description here"></a></p>