Figures won't render properly (if at all) in python script or Jupyter cells. #16323
Unanswered
jtskowronek
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm hoping to use VS Code like Spyder or Matlab for debug mode + plot interactivity in python scripts, but I can't even get figures to render properly in any scenario. I'm using matplotlib, but I'm open to any working alternatives.
1- In debug mode, how can I create a figure, plot to one or more axes, and interact with them one at a time before continuing evaluation of the remaining code? This is an absolutely crucial feature for debugging machine learning algorithms. I have scoured through all of the discussions on this topic on SO and elsewhere, but I have not come across a conclusive solution. I have tried all suggested options from the forums and from matplotlib, e.g. show() that blocks, show(block=False), ion() + draw() + pause(.001), etc. The session is essentially useless when using show() because I have to choose between having access to the figure or continuing execution of code. Any of the other options result in figures that are "(not responding)" on my Windows 10 machine, or axes that aren't interactive and then disappear after execution completes in Big Sur.
2- If I abandon hope for interactivity with figures from script in debug mode (particularly important to have on my Windows machine), and I try Jupyter cells, then my next issue is that the (fig, axes) I've created in a previous Jupyter cell aren't propagating to the next cell for use, even though the rest of my data is propagating. The cells are executing in ascending order as expected, so no apparent hiccup in the runtime.
3- In either of the above cases, how can I get figures to stay open after I run a script, debug mode or not? This is not an issue in any of the other IDEs I use, so it makes me think I'm missing a trivial but very poorly placed setting somewhere.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions