title: How do I force Matplotlib to draw while in the ipdb debugger in Spyder (or any other debugger)?
body: <p><strong>EDIT</strong></p>
  
  <p>Unfortunately, at the moment this is not possible. I found out that it is a <a href="http://code.google.com/p/spyderlib/issues/detail?id=610" rel="noreferrer">bug in Spyder</a>. The developers are <a href="http://code.google.com/p/spyderlib/issues/detail?id=733" rel="noreferrer">still figuring out how to approach this</a>.</p>
  
  <hr>
  
  <h2>Goal</h2>
  
  <p>Visualize data while debugging code (and I want to use Spyder too!).</p>
  
  <h3>Attempt #1: Run foo.bar from IPython from Spyder</h3>
  
  <ul>
  <li><p>Create a file named foo.py with the following code:</p>
  
  <pre><code>from ipdb import set_trace as st
  import matplotlib.pyplot as plt
  
  def bar():
      st()
  </code></pre></li>
  <li><p>While in IPython, type the following: </p>
  
  <pre><code>In [4]: import foo
  
  In [5]: foo.bar()
  --Return--
  None
  &gt; somewhere_over_the_rainbow\foo.py(5)bar()
        3 
        4 def bar():
  ----&gt; 5     st()
  
  ipdb&gt; plt.plot([1, 2], [3, 4])
  [&lt;matplotlib.lines.Line2D object at 0x05CA8E90&gt;]
  ipdb&gt; plt.show()
  </code></pre></li>
  </ul>
  
  <p>Plot remains in "frozen" state. If I exit debugger, plot updates. If I try to close the plot, IPython crashes. Obviously both undesirable, and neither lets me see the data while debugging.</p>
  
  <h3>Attempt #2: Run foo.bar from IPython from command line</h3>
  
  <ul>
  <li>Use same foo.py as in Attempt #1:</li>
  <li><p>Open IPython from commandline: </p>
  
  <pre><code>In [4]: import foo
  
  In [5]: foo.bar()
  --Return--
  None
  &gt; somewhere_over_the_rainbow\foo.py(5)bar()
        3
        4 def bar():
  ----&gt; 5     st()
  
  ipdb&gt; plt.plot([1, 2], [3, 4])
  [&lt;matplotlib.lines.Line2D object at 0x03904070&gt;]
  ipdb&gt; plt.show()
  </code></pre></li>
  </ul>
  
  <p>Program shows plot as I expect. BUT I want to use Spyder.</p>
  
  <h3>Attempt #3: Run baz.bar from IPython from command line</h3>
  
  <ul>
  <li><p>Write baz.py:</p>
  
  <pre><code>from ipdb import set_trace as st
  import matplotlib.pyplot as plt
  
  st()
  </code></pre></li>
  <li><p>Open IPython from commandline: </p>
  
  <pre><code>In [4]: import baz
  --Return--
  None
  &gt; somewhere_over_the_rainbow\baz.py(4)&lt;module&gt;()
        2 import matplotlib.pyplot as plt
        3 
  ----&gt; 4 st()
  
  ipdb&gt; plt.
  </code></pre></li>
  </ul>
  
  <p>Then Spyder fully freezes.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>Note #1</strong>: In my full code, I have many files and many functions, so mashing it all together in one script without functions is not viable.</p>
  
  <p><strong>Note #2</strong>: Using any matplotlib interactive command (e.g. ion(), interactive(True), etc.) had no effect.</p>
  
  <p><strong>Note #3</strong>: Spyder version 2.0.12, Python 2.6, matplotlib 1.0.1.</p>