-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
plt.ioff() not supressing figure generation #14950
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
Comments
If I remember correctly, Spyder has its own backend, right? I wonder if
they aren't properly recognizing `ioff()`? Does the same issue happen when
running the code from a vanilla python interface?
…On Thu, Aug 1, 2019 at 12:04 AM Yoshi2112 ***@***.***> wrote:
Bug report
*Bug summary*
Usual behaviour for supressing plots (by enabling plt.ioff()) no longer
working since update to latest version of conda.
*Code for reproduction*
import numpy as npimport matplotlib.pyplot as plt
x = np.random.rand(10)
y = np.random.rand(10)
plt.ioff()
plt.plot(x, y)
*Actual outcome*
In Spyder IDE, still generates figure window.
*Expected outcome*
Figure window should not appear. Disabling
*Matplotlib version*
- Operating system: Windows 10
- Matplotlib version: 3.1.0
- Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
- Python version: 3.7.3
- Jupyter version (if applicable):
- Other libraries: numpy 1.16.4
conda
Default channel (via https://www.anaconda.com/distribution/ )
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14950?email_source=notifications&email_token=AACHF6AKPBEVDATEUY22WHTQCJOGJA5CNFSM4IIMQMPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCW6HVQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACHF6GWJQR3GZ3PB7K6NWLQCJOGJANCNFSM4IIMQMPA>
.
|
Spyder does not have its own backend (PyCharm has, though). Many people like this mode, because it allows to choose a backend on a by-file- or by-project basis etc., but support for consequences of using this should probably directed towards Spyder. |
If I force inline plots by disabling Matplotlib support in Spyder, the interactive mode works correctly. Inline also works correctly when manually selected as the graphics backend. The other modes don't work as I'd expect. I'd always used the "Automatic" setting, which would probably be Qt5. Manually selecting Qt5 had the behaviour described in the OP - plt.ioff() failed to suppress the generation of a figure window. Of the other two modes, Qt4 failed to run because Qt5 was running (?), and Tkinter was successfully suppressed, but failed to display a plot when interactive mode was selected. A figure window was generated, but frozen. This might be an issue with missing modules or something though? I'm not exactly a dev. Is this a problem with matplotlib? Or perhaps an issue with the Spyder IDE failing to adhere to the interactive mode settings? |
Chiming in in behalf of Spyder. We set the Matplotlib backend using the |
Indeed it doesn't look like a Spyder issue. I was able to reproduce solemnly on the Ipython QtConsole, running Now it turns out this is indeed a matplotlib issue. #12637 ("Tell IPython the correct GUI event loop to use for all backends.") |
Suspect that ipython/ipython#11837 is also related. |
I suspect that if you call |
Yes, but that's not really an option if you want to run your whole code in one cell, like e.g. spyder does. |
See #14979 for the fix of the IPython side issue; and thomas is right that the piece of code that is responsible for the IPython-side-issue seem to also enable matplotlib gui integration and switch back to interactive. It seem to be triggered as a side effect of |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug summary
Usual behaviour for supressing plots (by enabling plt.ioff()) no longer working since update to latest version of conda.
Code for reproduction
Actual outcome
In Spyder IDE, still generates figure window.
Expected outcome
Figure window should not appear. plt.ioff() should disable interactive mode, and require a plt.show() call to generate figure window.
Matplotlib version
print(matplotlib.get_backend())
): Qt5Aggconda
Default channel (via https://www.anaconda.com/distribution/ )
The text was updated successfully, but these errors were encountered: