Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force Matplotlib to draw while in the ipdb debugger in Spyder #733

Closed
spyder-bot opened this issue Feb 17, 2015 · 1 comment
Closed

Force Matplotlib to draw while in the ipdb debugger in Spyder #733

spyder-bot opened this issue Feb 17, 2015 · 1 comment

Comments

@spyder-bot
Copy link
Collaborator

From zylor...@gmail.com on 2011-08-16T12:48:08Z

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 )

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=733

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2011-08-16T11:41:01Z

Oh 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

Status: Duplicate
Mergedinto: 620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant