Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Figures in windows not tabs #13164

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

Closed
hutattedonmyarm opened this issue Jan 12, 2019 · 6 comments · Fixed by #26071
Closed

Figures in windows not tabs #13164

hutattedonmyarm opened this issue Jan 12, 2019 · 6 comments · Fixed by #26071

Comments

@hutattedonmyarm
Copy link

I want to create multiple figure with Matplotlib in python, using the macosx backend. Currently, my code looks something like this:

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2, 100)

f1 = plt.figure(1)
plt.plot(x,x**2)

f2 = plt.figure(2)
plt.plot(x,x**2)
plt.show()

This creates a single window, with two tabs. One for figure 1, and one for figure 2. I suggest an option to open them in separate windows.

Note that the tabs likely come from the automatic tab-support built into the OS since macOS 10.12
Matplotlib version

  • Operating system: macOS 10.14.3
  • Matplotlib version: 3.0.2
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.7.1
  • Jupyter version (if applicable): -
  • Other libraries: -
  • Installed via: pip
  • Python installation via pyenv
@ImportanceOfBeingErnest
Copy link
Member

It seems this an OS "feature". Is this of any help?

@hutattedonmyarm
Copy link
Author

Kind of. Changing that setting does help, however it affects all applications. I generally prefer things opening in new tabs, but in this case I don't. Applications can override this system-wide setting. Seems like none of the backends override it (or give the option to override it)

@tacaswell
Copy link
Member

@hutattedonmyarm I think we are 👍 adding that feature to atleast the OSX backend (as it is clearly mac-specific) if you are interested in implementing it.

For the other backends, it would need to be done in a way that does not affect non-OSX users.

@hutattedonmyarm
Copy link
Author

I played with the source a bit. I managed to change the behavior, but it should be optional. I'm assuming this would be set using rcParams, or maybe as a backend function? I'm very new to using Matplotlib, so not sure what the best way is

@tacaswell
Copy link
Member

We do have precedence for GUI specific rcparams (osx.figure_mode ?), I do not think we have precedence for backend specific static methods.

It may also be that this is best done as a documentation PR showing how to change the application settings.

@hutattedonmyarm
Copy link
Author

Alright, will use rcparams then. I'll have to find how to read the params, and then update the docs

@timhoffm timhoffm modified the milestones: v3.1.0, v3.2.0 Feb 15, 2019
@timhoffm timhoffm modified the milestones: v3.2.0, v3.3.0 Sep 6, 2019
@QuLogic QuLogic modified the milestones: v3.3.0, v3.4.0 May 7, 2020
@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Sep 25, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Jul 8, 2022
@QuLogic QuLogic modified the milestones: v3.7.0, future releases Jan 10, 2023
@QuLogic QuLogic modified the milestones: future releases, v3.8.0 Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants