title: How can I speed up an animation?
body: <p>I'm trying to create a Matplotlib animation of my paw data, where you can see the pressure distribution on <a href="https://i.stack.imgur.com/ct8ub.gif" rel="nofollow noreferrer">the entire pressure plate over time</a> (256x64 sensors for 250 frames).</p>
  
  <p>I found a <a href="http://matplotlib.sourceforge.net/examples/animation/dynamic_image_wxagg2.html" rel="nofollow noreferrer">working example on Matplotlib's own site</a> and managed to get it working on my own data. However the 'animation' is awfully slow and I have no idea how to speed it up.</p>
  
  <p>Here's an example of a gif Joe Kington <a href="https://stackoverflow.com/questions/4087919/how-can-i-improve-my-paw-detection/4092160#4092160">made in another answer</a>, which is about the speed with which it gets displayed. Considering the measurements are done at 125 Hz, this makes the measurements look awfully slow. If it ran at 30-60 fps, it could be run in 4 or 8 seconds rather than the current 20+.</p>
  
  <p><img src="https://i.stack.imgur.com/AByKS.gif" alt="enter image description here"> <img src="https://i.stack.imgur.com/0IJuB.gif" alt="enter image description here"></p>
  
  <p>I don't mind using whatever tool I need to get the job done, as long as there's some good documentation to figure out how to do it.</p>
  
  <p>So my question is: <strong>how can I speed up these animations?</strong></p>
  
  <p><a href="http://pastebin.com/6iiuAQJY" rel="nofollow noreferrer">I've implemented Ignacio's suggestion</a> to put in t.Start(1), however it only runs 'decently' when the Figure is this large:</p>
  
  <p><img src="https://i.stack.imgur.com/YjBVb.png" alt="enter image description here"></p>
  
  <pre><code>class PlotFigure(Frame):
      """ This class draws a window and updates it with data from DataCollect
      """
      def __init__(self):
          Frame.__init__(self, None, -1, "Test embedded wxFigure")
          #Varying the size of Figure has a big influence on the speed            
          self.fig = Figure((3,3), 75) 
          self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
          EVT_TIMER(self, TIMER_ID, self.onTimer)
  
      def init_plot_data(self):
          self.datagen = DataCollect(array3d)
          self.axes = self.fig.add_subplot(111)
          self.axes.imshow(self.datagen.next().T)
  
      def onTimer(self, evt):
          self.data = self.datagen.next()
          self.axes.imshow(self.datagen.next().T)
          self.canvas.draw()
  </code></pre>
  
  <p>When I resize the window during the animation, it immediately slows down to a crawl. Which makes me suspect the delay isn't the only cause of the slow down. <strong>So any other suggestions?</strong> In case you're curious, <a href="http://dl.dropbox.com/u/5207386/rolloff" rel="nofollow noreferrer">here's a link to one of the ASCII files.</a></p>