title: More Efficient Alternatives to plt.draw() in MatPlotLib
body: <p>I'm trying to make an interactive GUI using MatPlotLib, and the thing users notice most is the latency between, say, changing a slider, and the GUI responding.  </p>
  
  <p>Currently, I am using <code>plt.draw()</code> at the end of every event, which works well, except for the fact that it causes <code>256ms</code> of the function's <code>259ms</code> runtime.</p>
  
  <p>In researching alternatives to <code>plt.draw()</code>, I came across this post: <a href="https://stackoverflow.com/questions/8955869/why-is-plotting-with-matplotlib-so-slow">why is plotting with Matplotlib so slow?</a> , in which it was recommended to use <code>fig.canvas.blit(ax1.bbox)</code> as an alternative which reloads just the graph, and not the entire figure.<br>
  When I use this, the event handler runs in <code>3ms</code>, however the GUI updates during the following event, rather than at the end of the current event as if the event was caught in a buffer: <code>User input 1</code>><code>pause</code>><code>User input 2</code>><code>GUI responds to input 1</code>><code>pause</code>><code>User input 3</code>><code>GUI responds to input 2</code>, making the program unusable.</p>
  
  <p>So what alternatives do I have?  Fixing either one of these problems would allow me to run a very fast GUI.  I'll post code if you need it.</p>
  
  <p>Note 1:  When using <code>fig.canvas.blit(ax1.bbox)</code>, the sliders, buttons, etc will change immediately, and only the subplots will behave as described above.</p>
  
  <p>Note 2: <code>fig.canvas.draw_idle()</code>, as used in the widgets example here <a href="http://matplotlib.org/examples/widgets/slider_demo.html" rel="nofollow noreferrer">http://matplotlib.org/examples/widgets/slider_demo.html</a>, and <code>fig.canvas.draw()</code>, perform identically to <code>plt.draw()</code></p>