title: How to annotate a range of the x axis in matplotlib?
body: <p>I want to make an annotation, something like <a href="http://matplotlib.org/users/annotations_intro.html" rel="noreferrer">here</a>, but I need to show a <em>range in x</em> instead of a single point. It's something like the <a href="https://en.wikipedia.org/wiki/Engineering_drawing#/media/File:Line_types.png" rel="noreferrer">dimension lines</a> in technical drawing.</p>
  
  <hr>
  
  <p>Here is an example of what I am looking for:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  xx = np.linspace(0,10)
  yy = np.sin(xx)
  
  fig, ax = plt.subplots(1,1, figsize=(12,5))
  ax.plot(xx,yy)
  ax.set_ylim([-2,2])
  # -----------------------------------------
  # The following block attempts to show what I am looking for
  ax.plot([4,6],[1,1],'-k')
  ax.plot([4,4],[0.9,1.1],'-k')
  ax.plot([6,6],[0.9,1.1],'-k')
  ax.annotate('important\npart', xy=(4, 1.5), xytext=(4.5, 1.2) )
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/a6jJ1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/a6jJ1.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>How do I annotate a range in a maplotlib graph?</strong></p>
  
  <hr>
  
  <p>I am using: </p>
  
  <p>python: 3.4.3 + numpy: 1.11.0 + matplotlib: 1.5.1</p>