r/Python • u/schnadamschnandler • Jan 10 '17
IPython shell with %matplotlib: the qt windows displaying figures disappear when I step away from the terminal application. Can this be fixed/is this typical behavior?
On my setup, figure windows created with the %matplotlib magic from an IPython shell (not entirely sure how this works) disappear after switching from my terminal application to any other running application, then back again. So, for example, if I am drawing a figure and want to check an /r/python thread in Chrome, after returning to my terminal application, I must re-declare the command plt.show().
Does this behavior sound atypical (something potentially wrong with my setup), or if it is typical, is there some possible workaround? Could this be unique to my installation/OS?
I am on MacOS Sierra, running the latest (just updated) versions of Anaconda and IPython. This problem is present using both iTerm2 and Terminal; does not seem to be related to the terminal application.
I tried asking in stackoverflow but they down voted my question without input, as is tradition.
View all comments
Show parent comment
1
u/flutefreak7 Jan 18 '17
Sorry for your pain!
Whoever said it was easier hasn't been down one of these rabbit holes before. The advantage with Python at times is that the rabbit hole is deeper and can lead to better treasure...
To be fair, the Matlab equivalent would be changing the Java runtime that Matlab uses and even that is benign compared to the complexity of matplotlib's many backends and the complexity of Python wrappers around half a dozen C and c++ based GUI framewords...
I hope this deep dive into the options was at least somewhat rewarding. Good luck finding a setup that works for you! It's not all this frustrating.