You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Figure sticks out of window after setting window to full screen from code #26733
When trying to display a a plot in full screen mode using pyplot, part of the figure is off the screen. The settings of the plot are definitely correct, since manually resizing the window fixes the issue.
Code for reproduction
importmatplotlib.pyplotaspltfig, ax=plt.subplots()
ax.plot([0],[0])
# plt.subplots_adjust(left=0.004, right=0.565, bottom=0.442, top=0.98) # <-- this line fixes it (on my screen)# the culpritplt.get_current_fig_manager().window.state('zoomed') # windowed full screen# plt.get_current_fig_manager().full_screen_toggle() # non-windowed full screen | this also breaks, but this time there is no x to close the windowplt.show()
Actual outcome
Expected outcome
Additional information
The issue can be manually fixed by calling plt.subplots_adjust with some predetermined values, obtained by playing around with the GUI sliders. But this is clearly not the intended way.
If plt.get_current_fig_manager().window.state('zoomed') is used, manually resizing the window (snapping it out and back into full screen) fixes the issue.
If plt.get_current_fig_manager().full_screen_toggle() is used, the window can not be dragged (since its really in full screen mode), but it can not even be closed, because there is no x in the top right corner (I don't know if that is intentional or not).
In the first case, it looks like you have a mismatch between cavas size and viewport size, where the viewport doesn't know about pixel doubling.
In the second case, on my Mac, the window controls show up if I move the mouse to the upper left corner.
I really don't think we control either of these functionalities - I think full_screen_toggle is what you want, but then you need to see how Windows will give you control of full screen app. Probably windows_key + shift + enter
I have investigated further and I realized that the bug only occurs, when the windows GUI scale (under Settings > System > Display > Scale and layout) is not set to 100%. Mine is at 175%, because I have a large resolution screen. Maybe there is something similar you can set on other OS-s to reproduce. That being said, the bug is probably unique to Windows.
I have investigated further and I realized that the bug only occurs, when the windows GUI scale (under Settings > System > Display > Scale and layout) is not set to 100%. Mine is at 175%, because I have a large resolution screen. Maybe there is something similar you can set on other OS-s to reproduce. That being said, the bug is probably unique to Windows.
Activity
jklymak commentedon Sep 11, 2023
Both work fine on my Mac, after
In the first case, it looks like you have a mismatch between cavas size and viewport size, where the viewport doesn't know about pixel doubling.
In the second case, on my Mac, the window controls show up if I move the mouse to the upper left corner.
I really don't think we control either of these functionalities - I think
full_screen_toggleis what you want, but then you need to see how Windows will give you control of full screen app. Probably windows_key + shift + entermategyerek commentedon Sep 11, 2023
I have investigated further and I realized that the bug only occurs, when the windows GUI scale (under Settings > System > Display > Scale and layout) is not set to 100%. Mine is at 175%, because I have a large resolution screen. Maybe there is something similar you can set on other OS-s to reproduce. That being said, the bug is probably unique to Windows.
ksunden commentedon Sep 11, 2023
If I remember correctly, we do not have hidpi support for Tk, largely because I don't think TK natively has High-DPI supportI remembered incorrectly: #19167
See also: #21875
kohinoorbasu commentedon Mar 31, 2026
This fixed my issue. Thanks for the resolution.