-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: macosx allow figures to be opened in tabs or windows #26071
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
Conversation
My suspicion is that this is so Mac-specific that #13164 (comment) ("osx.window_mode") makes more sense than "figure.window_mode". Getting tabs in other backends will require putting in tabbed-window widgets. Instead of using an rcParam, it would be more natural to explicitly instantiate a TabContainer when needed. Functions creating a Figure could then have an optional kwarg specifying that TabContainer as a destination. All that is a lot of work, multiplied by the number of backends to be supported. It would be a nice feature, but on my mental list of GUI enhancements it's not at the top--which is auto-scrollbars, so that large figures can be viewed on a modest screen without having to mess with figure size and/or dpi (#7338). That would also be a lot of work to implement. |
c345f0c
to
1226e03
Compare
Updated to |
To do this for all backends the right hook is matplotlib/lib/matplotlib/pyplot.py Lines 347 to 367 in 083b1a0
matplotlib/lib/matplotlib/backend_bases.py Lines 1769 to 1780 in 083b1a0
matplotlib/lib/matplotlib/backend_bases.py Lines 2665 to 2673 in 083b1a0
I think that the path to getting tabbed versions of the other backends would be a sub-class with either a custom |
Since this is basically an OS feature and the only Matplotlib API involved is an rcParam, I would be ok to add this only for osx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, works great on my intel mac.
There have been various various requests and attempts at implementing tabs in the past, the conversation has mostly been directed to #2194. There have been reservations raised on the basis of parity between GUI backends. If this is something we want for all gui backends, then I'm not sure about making the rcparam specific to macosx, but also don't like having options without the implementation for the other backends, so not sure... I think we should add this to the meeting schedule to discuss in a higher bandwidth setting. |
Allow users to select how new figures are created when opening new windows. The default is to keep using the system preferences, but one can also select "tab" or "window" to override the default system preferences.
Co-authored-by: Kyle Sunden <[email protected]>
PR summary
Allow users to select how new figures are created when opening new windows. The default is to keep using the system preferences, but one can also select "tab" or "window" to override the default system preferences. I've called the new rcParam
figure.window_mode
, but definitely open to other suggestions. This is currently only enabled on macosx backend, but I could see it being possible on others in the future as well which is why I put it underfigure.*
and not under the more specificmacosx.*
, but I could also see how this would lead to confusion when users set this and don't get the desired result.closes #13164
Example of the first figure opening in a new window, and the next two figures opening in a separate window with tabs.
PR checklist