title: Filling region between curve and x-axis in Python using Matplotlib
body: <p>I am trying to simply fill the area under the curve of a plot in Python using MatPlotLib.</p>
  
  <p>Here is my SSCCE:</p>
  
  <pre><code>import json
  import pprint
  import numpy as np
  import matplotlib.pyplot as plt
  
  y = [0,0,0,0,0,0,0,0,0,0,0,863,969,978,957,764,767,1009,1895,980,791]
  x = np.arange(len(y))
  
  
  fig2, ax2 = plt.subplots()
  ax2.fill(x, y)
  
  plt.savefig('picForWeb.png')
  plt.show()
  </code></pre>
  
  <p>The attached picture shows the output produced.<img src="https://i.stack.imgur.com/EeWtO.png" alt="output of fill"></p>
  
  <p>Does anyone know why Python is not filling the entire area in between the x-axis and the curve?</p>
  
  <p>I've done Google and StackOverflow searches, but could not find a similar example.  Intuitively it seems that it should fill the entire area under the curve.</p>