interactive plots in debug mode, MacOS (maybe not a Spyder problem)?

140 views
Skip to first unread message

Andrew Voelkel

unread,
Feb 13, 2020, 1:53:17 PM2/13/20
to spyder
Hi,

First, I have to say that overall, Spyder 4 is a joy and a huge improvement. Thanks to everyone for creating it.

I've been doing a lot of experimenting trying to get a Matlab type plotting experience. That means being able to get interactive plots up, and then with the plot up, be able to continue evaluating expressions, etc. 

This all works fine I just evaluate expressions or functions, but not in debug mode. If I'm stopped at a breakpoint after a plot command, the plot will not appear until I "continue" and exit debug mode.



Example code is above. I've tried various matplotlib backends. I also tried experimenting with the debug mode in Visual Studio Code instead of Spyder, and see similar issues. For that reason, I tend to think that this is not a Spyder problem per se but an issue with the underlying Python infrastructure.

But I figured there would be a lot of expertise here to understand the issue better.

Thanks for any help. This is kind of the last step to getting a Matlab type experience. It's frustrating not to be able to get there.

- Andy

bcolsen

unread,
Feb 14, 2020, 11:30:44 AM2/14/20
to spyder
Plotting while in debug is tricky to get right. See here for more information: https://github.com/ipython/ipykernel/pull/438

The current work around is to use plt.pause(10) this will render your graph and let you interact with is for the number or seconds given (in this case 10).
Reply all
Reply to author
Forward
0 new messages