title: How to create a line chart using Matplotlib
body: <p>I am trying to create a line chart for a sample data shown in screenshot.
  I googled quite a bit and looked at some links below and tried to use <code>matplotlib</code>, but I could not get the desired output as shown in the linegraph (screenshot) below, can anyone provide me a sample reference to get started? How to get the line chart with the sample input shown below?</p>
  
  <p><a href="http://www.josechristian.com/programming/smooth-line-plots-python/" rel="noreferrer">http://www.josechristian.com/programming/smooth-line-plots-python/</a>
  <a href="http://yaboolog.blogspot.com/2011/07/python-tips-create-line-graph-with.html" rel="noreferrer">http://yaboolog.blogspot.com/2011/07/python-tips-create-line-graph-with.html</a></p>
  
  <p><a href="https://i.stack.imgur.com/ddQcE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ddQcE.png" alt="linechart"></a></p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  # just create some random data
  fnx = lambda : np.random.randint(3, 10, 10)
  y = np.row_stack((fnx(), fnx(), fnx()))   
  # this call to 'cumsum' (cumulative sum), passing in your y data, 
  # is necessary to avoid having to manually order the datasets
  x = np.arange(10) 
  y_stack = np.cumsum(y, axis=0)   # a 3x10 array
  
  fig = plt.figure()
  
  plt.savefig('smooth_plot.png')
  </code></pre>