title: how do I redraw an image using python's matplotlib?
body: <p>What I am trying to do seems to be fairly straightforward, but I'm having a heck of a time trying to get it to work. I am simply trying to draw an image using imshow and then re-draw it periodically as new data arrives.</p>
  
  <p>I've started out with this:</p>
  
  <pre><code>fig = figure()
  ax = plt.axes(xlim=(0,200),ylim=(0,200))
  myimg = ax.imshow(zeros((200,200),float))
  </code></pre>
  
  <p>Then I'm assuming I can call set_data like this to update the image:</p>
  
  <pre><code>myimg.set_data(newdata)
  </code></pre>
  
  <p>I've tried many other things, for example I've called <code>ax.imshow(newdata)</code> instead or I've tried using <code>figure.show()</code> after <code>set_data()</code>. </p>