Title: [Bug]: set_rticks makes polar autoscale move the origin away from zero · Issue #29528 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: set_rticks makes polar autoscale move the origin away from zero · Issue #29528 · matplotlib/matplotlib
X Title: [Bug]: set_rticks makes polar autoscale move the origin away from zero · Issue #29528 · matplotlib/matplotlib
Description: Bug summary On polar axes, autoscaling (which only applies on the radial direction) normally avoids moving the origin away from r=0 (unless there's negative radius data). However, this behavior is lost if set_rticks has been called first...
Open Graph Description: Bug summary On polar axes, autoscaling (which only applies on the radial direction) normally avoids moving the origin away from r=0 (unless there's negative radius data). However, this behavior is ...
X Description: Bug summary On polar axes, autoscaling (which only applies on the radial direction) normally avoids moving the origin away from r=0 (unless there's negative radius data). However, this behavior...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29528
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: set_rticks makes polar autoscale move the origin away from zero","articleBody":"### Bug summary\n\nOn polar axes, autoscaling (which only applies on the radial direction) normally avoids moving the origin away from r=0 (unless there's negative radius data). However, this behavior is lost if set_rticks has been called first.\n\n(split out of #29516)\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\n\nax = plt.figure().add_subplot(projection=\"polar\")\nax.plot([0, 1], [2, 3]) # theta, r\nprint(ax.get_ylim()) # -\u003e rlim = (0, 3.05), OK: lower r=0 bound forced\n\nax = plt.figure().add_subplot(projection=\"polar\")\nax.set_rticks([1, 2, 3, 4])\nprint(ax.get_ylim()) # -\u003e rlim = (0, 4), OK\nax.plot([0, 1], [2, 3]) # theta, r\nprint(ax.get_ylim()) # -\u003e rlim = (1.95, 3.05), oops: lower r=0 bound lost\n```\n\n### Actual outcome\n\nSee comments in code.\n\n### Expected outcome\n\nThe last autoscaling should also set rlims to (0, 3.05).\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nany\n\n### Matplotlib Version\n\n3.11.0.dev342+g3b54c6abab\n\n### Matplotlib Backend\n\nagg\n\n### Python version\n\n3.13\n\n### Jupyter version\n\nno\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2025-01-27T10:06:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/29528/matplotlib/issues/29528"}
| 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:77646ea4-5a4c-fac1-7c37-a6b49e3e6766 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD00:1C0710:28B559:36C280:6A522883 |
| html-safe-nonce | e6796c8405e730df011672ec49a1859449ace1f99395b35d72558993ac9394e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDAwOjFDMDcxMDoyOEI1NTk6MzZDMjgwOjZBNTIyODgzIiwidmlzaXRvcl9pZCI6Ijc2NTYwMDk0MDg1NjA5MDAyMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 244a1b8dc4252332114c0cb06e733aaa0f79bca31228ea94f36aafd7aa7956a8 |
| hovercard-subject-tag | issue:2812579152 |
| 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/29528/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b37cd226ac0ee944c970827501c590235fce05cd08e4643b6fb423903f400f6/matplotlib/matplotlib/issues/29528 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b37cd226ac0ee944c970827501c590235fce05cd08e4643b6fb423903f400f6/matplotlib/matplotlib/issues/29528 |
| og:image:alt | Bug summary On polar axes, autoscaling (which only applies on the radial direction) normally avoids moving the origin away from r=0 (unless there's negative radius data). However, this behavior is ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width