FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Universal fullscreen command · Issue #17714 · matplotlib/matplotlib · GitHub

Repository navigation

Universal fullscreen command  #17714

Closed
Closed

Description

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.

Activity

  1. changed the title [-]Native and Backends versatile fullscreen command [/-] [+]Backends should provide a fullscreen command [/+] on Jul 4, 2020
  2. changed the title [-]Backends should provide a fullscreen command [/-] [+]Universal fullscreen command [/+] on Jul 4, 2020
  3. timhoffm commented on Jul 4, 2020

    Member

    AFAICS the request is better matched by the changed title:
    The user should have a universal way of making a figure fullscreen.

    There is already FigureManager.full_screen_toggle (but it's not implemented for all backends).

    @Luluser please be more specific in your request: You write "fullscreen", but the code snippet just maximizes the window. These are two different things. Fullscreen does not have the window title bar. What exactly do you want to achieve.

  4. Luluser commented on Jul 5, 2020

    Thank you for the answer.
    The thing I would have liked to be already implemented when working on my project was an universal full screen command. Failing that and the knowledge of every command for every OS and Matplotlib backends, I have used pieces of code found here and there and added my own ideas. This is why those are maximised window commands, but I was hoping for fullscreen one to be honest.

    I hope my post is clear.

    In addition if there were an universal maximised window command I would have used it but there is no such thing, at least that I know, either.
    Have a great day.

  5. timhoffm commented on Jul 5, 2020

    Member

    @Luluser does

    mng = plt.get_current_fig_manager()
    mng.full_screen_toggle()
    

    work for you? Note that you can also toggle fullscreen using the shortcut f.

    This is currently implemented for GTK3, Qt, and Tk. #17843 will add support for wx.

  6. Luluser commented on Jul 7, 2020

    It does work on my computer, I haven't had the opportunity to test it on other configurations tho.
    Thank you for the tip I didn't know the shortcut.

    Great to read, are there any plans to have the same kind of command to maximise the window ? It would be great aswell.

  7. timhoffm commented on Jul 7, 2020

    Member

    Great to read, are there any plans to have the same kind of command to maximise the window ? It would be great aswell.

    Currently not. There are usually OS shortcuts for that already, e.g. Win+Up or Win+PgUp depending on your OS and window manager.

  8. added this to the v3.4.0 milestone on Jul 7, 2020
  9. timhoffm commented on Jul 16, 2020

    Member

    "Fullsceen" is available. "Maximize" is provided by the OS - no plan to add that from our side again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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


      Back | FazBrowse Home | New Git URL