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.
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.
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.
Activity
timhoffm commented on Jul 4, 2020
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.
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.
timhoffm commented on Jul 5, 2020
@Luluser does
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.
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.
timhoffm commented on Jul 7, 2020
Currently not. There are usually OS shortcuts for that already, e.g. Win+Up or Win+PgUp depending on your OS and window manager.
timhoffm commented on Jul 16, 2020
"Fullsceen" is available. "Maximize" is provided by the OS - no plan to add that from our side again.