title: How to plot several graphs and make use of the navigation button in [matplotlib]
body: <p>The latest version of <strong><code>matplotlib</code></strong> automatically creates navigation buttons under the <code>graph</code>. However, the examples I see in the Internet all just show how to create one graph, thus making the button <code>[Next]</code> and <code>[Previous]</code> useless. How do I plot several graphs and make use of those buttons?</p>
  
  <p>For example I want to make <code>graph</code> for <code>sin()</code> and <code>cos()</code> from <code>0</code> degree to <code>360</code> degree.</p>
  
  <p>Right now I do it like this:</p>
  
  <pre><code>import scipy
  from matplotlib import pyplot
  
  DataRange = range(0, 360)
  DataRange = map(scipy.deg2rad, DataRange)
  Data1 = map(scipy.sin, DataRange)
  Data2 = map(scipy.cos, DataRange)
  pyplot.plot(Data1)
  pyplot.show()   # &lt;--- if I exclude this
  pyplot.plot(Data2)
  pyplot.show()
  </code></pre>
  
  <p>The <code>sin()</code> graph will be shown. It is when I close the window that the <code>cos</code> graph will be shown. If I exclude the first <code>pyplot.show()</code>, both will be shown in the same figure.</p>
  
  <p>How to make it so that the second graph is shown when I press the Next button?</p>