title: Matplotlib fill area under curve between two x values only
body: <p>I'd like to fill the area under some curve between two values on the horizontal axis only. I tried</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  from scipy.stats import norm
  
  x = np.linspace(-4,4, 10000)
  nVals = [norm.pdf(i,0,1) for i in x]
  
  line = plt.plot(x,nVals)
  
  plt.fill_between(x,nVals,color = '#111111',where = x &gt; -3 and x &lt; -2)
  plt.axis([-4,4,0,.5])
  plt.show()
  </code></pre>
  
  <p>but it returns</p>
  
  <p><code>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</code></p>
  
  <p>I don't understand this message; when I run</p>
  
  <pre><code>z = -2.5
  print z &gt; -3 and z &lt; -2
  </code></pre>
  
  <p>Python <em>does</em> understand what I mean and prints</p>
  
  <p><code>True</code></p>
  
  <p>So why doesn't this work with <code>fill_between</code> and how can I solve that?</p>