Title: Figure sticks out of window after setting window to full screen from code · Issue #26733 · matplotlib/matplotlib · GitHub
Open Graph Title: Figure sticks out of window after setting window to full screen from code · Issue #26733 · matplotlib/matplotlib
X Title: Figure sticks out of window after setting window to full screen from code · Issue #26733 · matplotlib/matplotlib
Description: Bug summary 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 reproductio...
Open Graph Description: Bug summary 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 wind...
X Description: Bug summary 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 wind...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26733
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Figure sticks out of window after setting window to full screen from code","articleBody":"### Bug summary\r\n\r\nWhen 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.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\nax.plot([0],[0])\r\n\r\n# plt.subplots_adjust(left=0.004, right=0.565, bottom=0.442, top=0.98) # \u003c-- this line fixes it (on my screen)\r\n\r\n# the culprit\r\nplt.get_current_fig_manager().window.state('zoomed') # windowed full screen\r\n# 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 window\r\n\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n\r\n\r\n### Expected outcome\r\n\r\n\r\n\r\n\r\n### Additional information\r\n\r\nThe 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.\r\n\r\nIf `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.\r\nIf `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).\r\n\r\nOriginal SO post [here](https://stackoverflow.com/questions/77009585/figure-sticks-out-of-window-after-setting-window-to-fullscreen-using-a-tkagg-bac).\r\n\r\nEDIT: The error only occurs, when the Windows GUI scale (under Settings \u003e System \u003e Display \u003e Scale and layout) is not set to 100%.\r\n\r\n### Operating system\r\n\r\nWindows 10\r\n\r\n### Matplotlib Version\r\n\r\n3.7.1\r\n\r\n### Matplotlib Backend\r\n\r\nTkAgg\r\n\r\n### Python version\r\n\r\n3.10.12\r\n\r\n### Jupyter version\r\n\r\nNA\r\n\r\n### Installation\r\n\r\nconda","author":{"url":"https://github.com/mategyerek","@type":"Person","name":"mategyerek"},"datePublished":"2023-09-11T15:08:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/26733/matplotlib/issues/26733"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:331846c1-d187-a875-ab31-a9c68cfa19bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EE6:2C6FDB:1C53B2:25D98A:6A52C4AB |
| html-safe-nonce | 171fbe39f962572ae50c32ee0639639273a646a047c5e8984b541310630ed555 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUU2OjJDNkZEQjoxQzUzQjI6MjVEOThBOjZBNTJDNEFCIiwidmlzaXRvcl9pZCI6IjIzNjIxMzM1NTI0NTg1NDgzOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f05629a033750d95c2f1bc0953f04319a488738022f13c9185d348b7c69e694d |
| hovercard-subject-tag | issue:1890727894 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/26733/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5baf829656abba1db067373565741ef230dfb4884ca2b05e2f8ee4bfe705e3f/matplotlib/matplotlib/issues/26733 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5baf829656abba1db067373565741ef230dfb4884ca2b05e2f8ee4bfe705e3f/matplotlib/matplotlib/issues/26733 |
| og:image:alt | Bug summary 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 wind... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mategyerek |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width