-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
don't let matplotlib pop up all opened windows #10972
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
This needs a minimal example to see what you are talking about. |
It also looks like you're using an old version of Matplotlib. Could you upgrade to version |
@dstansby Yes |
I cannot reproduce this behavior on master. Please give a step-by-step example what you are doing. |
This sounds like the kind of thing that might not be under our control; it results from the interaction between the gui library and the window manager. |
Thanks for all the feedbacks, I didn't think this would get any more attention as it's not a crucial problem and I already found a workaround. This happened after I did a fresh install of Manjaro (17.1.6, with Cinnamon 3.6.6) and installed a newer anaconda (4.4.10).
Then a new window pops as expected. Repeat the last line a few times, each time a new window opens, it also brings all existing figure windows to the front. While using It could be the interaction with the window manager as @efiring said, because I moved onto a new system and a new conda (probably new matplotlib as well) at the same time. |
I'm not really following this problem. On my Mac, the terminal is a separate application from the backend. If a figure takes focus, the graphics backend is the front application. If I want to switch back to the terminal and can command-tab to get the terminal application back. If I want to see other figures I can scroll through them with command-`. On your machine is the terminal not a different application from the python output windows? Are you doing this inside some sort of IDE? Regardless, I'm not at all convinced this has anything to do with Matplotlib, and am tempted to close unless you think there is something we should be doing on our end. |
If you've run |
Hi, I would just like to clarify, using the following test script:
without the I would also like to express appreciation that matplotlib is designed to allow such rapid prototyping without having to deal with GUI/threading concepts while still being able to handle events hence make the plots interactive. I know it would be simpler to use blocking mode and perform all tasks in the event handlers, but it is nice to have the choice. |
Maybe it's possible that tkagg has a different behaviour for focus than qt5agg for what windows it pops to the top? Maybe there is a setting we can control that governs this behaviour? |
I'm not at my pc now, but I use KDE ou Kubuntu. In Desktop/workspace settings, there are options to control how willingly/reluctantly focus can get stolen by apps. I guess different backends behave inconsistently for any given level of focus-grab prevention. |
There is an rcParam Please open a new issue with a reproducible example demonstrating what behavior is going wrong with details of what is happening vs what is expected. |
Bug report
Bug summary
My problem is kind of the opposite to this stackoverflow question: Matplotlib plt.show() method does not pop out the window that my matplotlib always pop up ALL the previously opened windows together with the new window
plt.show(block=False)
opens. This gets annoying when I need to debug the code by generating some plots,Alt-Tab
to switch back to code and generate some more plots. If only the last plot window is brought to the front, I need only 1 hit ofAlt-Tab
, now there will be a long list of tab-icons to go through before I get back to the code window.I'm pretty sure it didn't behave like this before, probably after I reinstalled Anaconda and got a different version of matplotlib.
The backend it currently uses is qt5agg, changing to Tkagg solves the problem.
Matplotlib version
print(matplotlib.get_backend())
): qt5aggInstalled via
conda install matplotlib
The text was updated successfully, but these errors were encountered: