Skip to content

Universal fullscreen command  #17714

Closed
Closed
@tacaswell

Description

@tacaswell

Converting #17710 to an issue (attn @Luluser)


Sharing my work with different persons I have dealt with them having different OS and Matplotlib Backend and had to play pingpong game with trial and errors to make it work on their desktop.
I think for example that a backend versatile fullscreen command would be great. I have found examples on the web quite easily but even then in some cases it didn't work on my colleagues' computers.
Here is a slightly different code I modified from the one I found :

    plot_backend = get_backend()
    mng = plt.get_current_fig_manager()
    if plot_backend == 'TkAgg':#Seems to be the most used backend
        try:
            mng.window.state('zoomed')#for Windows users
        except _tkinter.TclError:
            mng.resize(*mng.window.maxsize())#for Ubuntu users
    elif plot_backend == 'wxAgg':
        mng.frame.Maximize(True)
    elif plot_backend == 'Qt4Agg':
        mng.window.showMaximized()   

I am new to pull request some I mark it as a draft one. There are probably some cases forgotten, I don't pretend this code is perfect on the contrary your recommendations and enhancements are welcomed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions