title: in matplotlib, is there a way to pop up a figure asynchronously?
body: <p>In matplotlib, is there a simple way of plotting a figure without interrupting the control flow of the script?</p>
  
  <p>Using pseudocode for clarity, here's what I'm trying to achieve:</p>
  
  <pre><code>fig1 = figure()
  fig1.plot_a_figure(datasets)
  
  for dataset in datasets:
     results = analyze(dataset)    # this takes several minutes
     update(fig1)
     pop_up_another_figure(results) # would like to have a look at this one
                                    # while the next dataset is being processed
  </code></pre>
  
  <p>Of course, I can just savefig() these intermediate figures, but I only need a quick glance at a them and it would be the best to have them just pop up on the screen in real time. </p>
  
  <p>EDIT: A runnable example:</p>
  
  <pre><code>#!/usr/bin/python
  import pylab as plb
  import matplotlib.pyplot as plt
  
  fig1=plt.figure(1)
  ax = fig1.add_subplot(1,1,1)
  
  ax.plot([1,2,3],[4,5,6],'ro-')
  
  #fig1.show()  # this does not show a figure if uncommented
  plt.show()    # until the plot window is closed, the next line is not executed
  
  print "doing something else now"
  </code></pre>
  
  <p>Am I missing something very very basic?</p>