
spyderlib - issue #733
Force Matplotlib to draw while in the ipdb debugger in Spyder
What steps will reproduce the problem? 1. Create foo.py {{{ from ipdb import set_trace as st import matplotlib.pyplot as plt
def bar(): st() }}} 2. While in IPython in Spyder, type the following: {{{ In [4]: import foo
In [5]: foo.bar() --Return-- None > somewhere_over_the_rainbow\foo.py(5)bar() 3 4 def bar(): ----> 5 st()
ipdb> plt.plot([1, 2], [3, 4]) [<matplotlib.lines.Line2D object at 0x05CA8E90>] ipdb> plt.show() }}} Plot remains in "frozen" state. If I exit debugger, figure remains there not updated. If I try to close the plot, IPython crashes. Obviously both undesirable, and neither lets me see the data while debugging.
What is the expected output? What do you see instead? I expect to be able to create and see plots while in the debugger. {{{ plt.interactive(True) plt.plot([1, 2], [3, 4]) }}} should show a plot that updates, as it does in the normal interpreter.
What version of the product are you using? On what operating system? Using Python(x,y) 2.6.6.2, Spyder 2.0.12, Python 2.6.6, Qt 4.7.2, PyQt 4.8.4 (all 32-bit), Windows XP x64
Please provide any additional information below. Trying different backends (e.g. Qt4Agg, GTKCairo, TkAgg) has no effect. It is not a backend issue.
I feel this is important since one of the most useful features of Matlab was the ability to plot while debugging, so I could tell what the **** happened to my data. Please assure me that Python is the way to go!
(Also note that this issue does not arise when making plots in the command line, but Spyder is sooooooooooooooo much nicer! =D )
Comment #1
Posted on Aug 16, 2011 by Quick HorseOh man, I fought a lot to solve this one but failed. It's a problem with ipdb embedded in a GUI and the necessary threads to run separate matplotlib windows.
As I mentioned in Issue 610, I think the solution to this would be to create a proper plugin to do debugging, that could support this kind of interaction. I totally agree is fundamental to plot your data while debugging, but unfortunately it's not going to happen anytime soon.
Cheers, Carlos
Comment #2
Posted on Feb 17, 2015 by Quick HorseThis issue was migrated to https://github.com/spyder-ide/spyder/issues/
The issue number is exactly the same
Status: Duplicate
Labels:
Type-Defect
Priority-Medium
Restrict-AddIssueComment-Commit