Title: [Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend · Issue #25847 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend · Issue #25847 · matplotlib/matplotlib
X Title: [Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend · Issue #25847 · matplotlib/matplotlib
Description: Bug summary When using the gtk4cairo backend, and using a scaled resolution, part of the graph will be cut off. From the bug reports on Graphs, it seems like with 200% scaling, only 1/2 of the screen is used, and at 300% scaling it's abo...
Open Graph Description: Bug summary When using the gtk4cairo backend, and using a scaled resolution, part of the graph will be cut off. From the bug reports on Graphs, it seems like with 200% scaling, only 1/2 of the scre...
X Description: Bug summary When using the gtk4cairo backend, and using a scaled resolution, part of the graph will be cut off. From the bug reports on Graphs, it seems like with 200% scaling, only 1/2 of the scre...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/25847
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Graph gets cut off with scaled resolution using gtk4cairo backend","articleBody":"### Bug summary\r\n\r\nWhen using the gtk4cairo backend, and using a scaled resolution, part of the graph will be cut off.\r\nFrom the bug reports on [Graphs](https://github.com/Sjoerd1993/Graphs/), it seems like with 200% scaling, only 1/2 of the screen is used, and at 300% scaling it's about 1/3 of the screen etc...\r\n\r\nSee attached screencast. It goes back to normal when scaling is set to 100%.\r\n\r\n[Screencast from 2023-05-10 10-45-40.webm](https://github.com/matplotlib/matplotlib/assets/68477016/2c74d5a4-84b2-4fb6-9e16-05be345c7236)\r\n\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib\r\nmatplotlib.use(\"gtk4cairo\")\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n\r\n\r\n# Data for plotting\r\nt = np.arange(0.0, 2.0, 0.01)\r\ns = 1 + np.sin(2 * np.pi * t)\r\n\r\nfig, ax = plt.subplots()\r\nax.plot(t, s)\r\n\r\nax.set(xlabel='time (s)', ylabel='voltage (mV)',\r\n title='About as simple as it gets, folks')\r\nax.grid()\r\n\r\nfig.savefig(\"test.png\")\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nThe plot should always stretch over the entire area, and never cut off. \r\n\r\n### Expected outcome\r\n\r\nThe plot is cut off when using a scaled resolution. Note that it works fine with the gtk4agg backend, so it's definitely a bug in gtk4cairo. However, gtk4agg backend has other issues that prevent me from using that in Graphs.\r\n\r\n### Additional information\r\n\r\nI have been using Fedora 38 Silverblue on my computer, attached screencast is from a Fedora 36 toolbox. Problem persists in a Flatpak, and initial bug report on Graphs was from somebody running a Fedora 36 workstation desktop it seems.\r\n\r\nNote that the filled in versions below are from the environment that runs in my Toolbox container. But the problem persists in the Flatpak which runs Gnome 44 runtimes with Matplotlib 3.7.1 installed by Pip.\r\n\r\nSee issue on [Graphs](https://github.com/Sjoerd1993/Graphs/issues/259) for the context where I initially got confronted with this bug.\r\n\r\n### Operating system\r\n\r\nLinux Fedora Silverblue\r\n\r\n### Matplotlib Version\r\n\r\n3.6.0\r\n\r\n### Matplotlib Backend\r\n\r\nGTK4Cairo\r\n\r\n### Python version\r\n\r\nPython 3.10.8\r\n\r\n### Jupyter version\r\n\r\n6.4.12\r\n\r\n### Installation\r\n\r\nLinux package manager","author":{"url":"https://github.com/sstendahl","@type":"Person","name":"sstendahl"},"datePublished":"2023-05-10T08:52:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/25847/matplotlib/issues/25847"}
| 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:b1049006-b0ee-ee7d-e4c8-cdea53a0799c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84B4:279B75:2319B92:2FDEBBB:6A5399B0 |
| html-safe-nonce | f0dd2499430f015619f643ccf6ba82e26a9f3b91d75451b2a6ee0e7fd29501a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEI0OjI3OUI3NToyMzE5QjkyOjJGREVCQkI6NkE1Mzk5QjAiLCJ2aXNpdG9yX2lkIjoiNzY0NjM4NzA5MjY4MDA1NTIxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 478086918eb3678ae59459cd319a59d3ff978b6766184ee58307624ea1ec89e2 |
| hovercard-subject-tag | issue:1703423351 |
| 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/25847/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a7d772361809ef96e7815d791c0c7bdbe9dc4caa5ef91d5eeb3d40ca2045ea6/matplotlib/matplotlib/issues/25847 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a7d772361809ef96e7815d791c0c7bdbe9dc4caa5ef91d5eeb3d40ca2045ea6/matplotlib/matplotlib/issues/25847 |
| og:image:alt | Bug summary When using the gtk4cairo backend, and using a scaled resolution, part of the graph will be cut off. From the bug reports on Graphs, it seems like with 200% scaling, only 1/2 of the scre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sstendahl |
| 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