Title: [Bug]: `fill_between` with `get_xaxis_transform` increases y-limits · Issue #30320 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: `fill_between` with `get_xaxis_transform` increases y-limits · Issue #30320 · matplotlib/matplotlib
X Title: [Bug]: `fill_between` with `get_xaxis_transform` increases y-limits · Issue #30320 · matplotlib/matplotlib
Description: Bug summary In matplotlib 3.10.0, using fill_between() with transform=ax.get_xaxis_transform() increases the y-limits every time it is called, and the original plot gets squeezed gradually, which did not happen in previous version (3.8.0...
Open Graph Description: Bug summary In matplotlib 3.10.0, using fill_between() with transform=ax.get_xaxis_transform() increases the y-limits every time it is called, and the original plot gets squeezed gradually, which d...
X Description: Bug summary In matplotlib 3.10.0, using fill_between() with transform=ax.get_xaxis_transform() increases the y-limits every time it is called, and the original plot gets squeezed gradually, which d...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30320
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: `fill_between` with `get_xaxis_transform` increases y-limits","articleBody":"### Bug summary\n\nIn matplotlib 3.10.0, using `fill_between()` with `transform=ax.get_xaxis_transform()` increases the y-limits every time it is called, and the original plot gets squeezed gradually, which did not happen in previous version (3.8.0).\n\n### Code for reproduction\n\n```Python\n#Modified from https://matplotlib.org/stable/gallery/lines_bars_and_markers/fill_between_demo.html\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfig, ax = plt.subplots()\nx = np.arange(0, 4 * np.pi, 0.01)\ny = np.sin(x)\nax.plot(x, y, color='black')\n\nthreshold = 0.75\nax.axhline(threshold, color='green', lw=2, alpha=0.7)\nfor i in range(10):\n ax.fill_between(x + 0.5*i, 0, 1, where=y \u003e threshold, color='green', alpha=0.1, transform=ax.get_xaxis_transform())\n```\n\n### Actual outcome\n\n\u003cimg width=\"546\" height=\"413\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/429763b5-dc60-4871-918d-5d15252ae341\" /\u003e\n\n### Expected outcome\n\n\u003cimg width=\"568\" height=\"413\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0d15974c-a3bd-4b24-a51f-903010631c34\" /\u003e\n\n### Additional information\n\nThe expected outcome is from version 3.8.0\n\n### Operating system\n\nWindow 11\n\n### Matplotlib Version\n\n3.10.0\n\n### Matplotlib Backend\n\nmodule://matplotlib_inline.backend_inline\n\n### Python version\n\nPython 3.12.11\n\n### Jupyter version\n\n7.4.4\n\n### Installation\n\nNone","author":{"url":"https://github.com/metachow","@type":"Person","name":"metachow"},"datePublished":"2025-07-16T09:29:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/30320/matplotlib/issues/30320"}
| 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:6a5d8ee3-854c-91d1-613c-cbb72344050b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA9E:25BA60:A4CC94:DA6225:6A531C9E |
| html-safe-nonce | 3ffa334fa1d72e8d4f1e0e1651b10388660abe1ff99ec43dd969aca89a0d29cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTlFOjI1QkE2MDpBNENDOTQ6REE2MjI1OjZBNTMxQzlFIiwidmlzaXRvcl9pZCI6IjM5MjUzMzYwNzE3OTI5NTkwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9dddcc2ac67b3317f0762ac38e06a81b6bdc91fd431dd0046325796ab9bf5340 |
| hovercard-subject-tag | issue:3235183351 |
| 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/30320/issue_layout |
| twitter:image | https://opengraph.githubassets.com/559087cd99693a9e8a9799bb1816f5db26814a0ea0e0add35f7e4388c5083e47/matplotlib/matplotlib/issues/30320 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/559087cd99693a9e8a9799bb1816f5db26814a0ea0e0add35f7e4388c5083e47/matplotlib/matplotlib/issues/30320 |
| og:image:alt | Bug summary In matplotlib 3.10.0, using fill_between() with transform=ax.get_xaxis_transform() increases the y-limits every time it is called, and the original plot gets squeezed gradually, which d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | metachow |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width