title: Display sequence of images using matplotlib
body: <p>I have this simple python script using OpenCV to load images from a folder and display them in a loop. I want to reproduce this effect using <code>matplotlib</code>.</p>
  
  <pre><code>import cv2 as cv
  import os
  
  im_files = [for f in os.listdir('.') if f[-3:] == 'png']
  
  for f in im_files:
      im = cv.imread(f, 0) #read image in greyscale
      cv.imshow('display', im)
      cv.waitKey(1)
  
  cv.destroyAllWindows()
  </code></pre>
  
  <p>I tried the following script but the pyplot window which opens to display the plots becomes un responsive.</p>
  
  <pre><code>import pylab as pl
  import os
  
  files = [f for f in os.listdir('.') if f[-3:] == 'png']
  pl.ion()
  for f in files:
      im=pl.imread(f)
      pl.imshow(im)
      pl.draw()
  </code></pre>
  
  <p>I have googled a lot but couldn't find any solution. How do I go about doing this? I am using Anaconda 1.6 32bit on Windows 8.</p>