title: Show consecutive images/arrays with imshow as repeating animation in python
body: <p>I have calculated some results and they are in the form of 64x64 arrays. Each array is created some time after the other. I want to show these arrays one after the other, like an animation.
  I have tried many ways, and got none to work. Im am quite frustrated and the questions on SO regarding animations have not been able to help me get this to work. This is not the first time I try this, every time my result is the same though: I have never gotten this to work.</p>
  
  <p>The approaches I have tried:</p>
  
  <p><a href="http://matplotlib.org/examples/animation/dynamic_image.html" rel="nofollow">dynamic image</a></p>
  
  <p><a href="http://matplotlib.org/examples/animation/dynamic_image2.html" rel="nofollow">dynamic image 2</a></p>
  
  <p><a href="http://matplotlib.org/examples/animation/simple_anim.html" rel="nofollow">simple animation</a></p>
  
  <p>The current code I have:</p>
  
  <pre><code>fig, ax = plt.subplots()
  def animate(i):
      return imagelist[i] 
  def init():
      fig.set_data([],[])
      return fig
  ani = animation.FuncAnimation(fig, animate, np.arange(0, 19), init_func=init,
  interval=20, blit=True)
  plt.show()
  </code></pre>
  
  <p>Here imagelist is a list of the arrays I mention above (length 20, 0 through 19). My question is how can I get this to work?</p>