title: Figures "not responding" when generated in a while loop in Python Matplotlib
body: <p>Is it possible to have multiple figures generated and shown within a loop? I would like to display each figure, so that I can inspect it, before moving on to the the next one. To make this question clearer, I have written a little example of what I would like to do. At the moment, the figures are displayed as "not responding", so I can't see whats in them. I have tried using plt.waitforbuttonpress and plt.ion, but this doesn't seem to be working.</p>
  
  <p>I am using the spyder editor, but it would great if the solution could work in other editors as well (like idle). </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  pi = 3.14
  figureTime = 1.0
  
  x  = np.arange(0,2*pi,0.1)
  y1 = np.sin(x)
  y2 = np.cos(x)
  
  plt.ion()
  
  for i in xrange(1,11,1):
  
    plt.close('all')    
  
    # Figure 1
    plt.figure()
    plt.plot(x,y1*i)
    plt.show()
    plt.draw()
    plt.waitforbuttonpress(timeout=figureTime)
    raw_input("Press Enter to continue")
    plt.close()
  
  
    # Figure 2
    plt.figure()
    plt.plot(x,y2*i)
    plt.show()
    plt.draw()
    plt.waitforbuttonpress(timeout=figureTime)
    raw_input("Press Enter to continue")
    plt.close()
  </code></pre>