Title: [Bug]: title position incorrect for polar plot · Issue #29381 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: title position incorrect for polar plot · Issue #29381 · matplotlib/matplotlib
X Title: [Bug]: title position incorrect for polar plot · Issue #29381 · matplotlib/matplotlib
Description: Bug summary When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308 via #28300 Code for reproduction import matplotlib.pyplot as plt plt...
Open Graph Description: Bug summary When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308 via #28300 Code for reproduc...
X Description: Bug summary When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308 via #28300 Code for reproduc...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29381
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: title position incorrect for polar plot","articleBody":"### Bug summary\n\nWhen using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308e751a741f2e41c530befd2b99b26a6ac0 via #28300\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\r\n\r\nplt.polar([0, 1], [0, 1])\r\nplt.title('My Title')\r\nplt.savefig('output.png')\n```\n\n\n### Actual outcome\n\nThe title overlaps the axis labels\r\n\r\n\r\n\n\n### Expected outcome\n\nThe title should be above the axis labels\r\n\r\n\r\n\n\n### Additional information\n\n- This bug happens with the new 3.10 version, but with the 3.9.4 version\r\nI performed a git bisect using this:\r\n\r\n```bash\r\n git bisect start\r\n```\r\n```bash\r\ngit bisect good v3.9.4\r\n```\r\n```bash\r\ngit bisect bad HEAD\r\n```\r\na small test script `check.py` - there's probably a better way, but that's what I came up with. (Note that the issues also comes up when not using `bbox_inches='tight', but this way it was easier to bisect, since I could instrument the image size)\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfrom PIL import Image\r\n\r\ndef main():\r\n plt.polar([0, 1], [0, 1])\r\n plt.title('My Title')\r\n plt.savefig('output.png', bbox_inches='tight')\r\n with Image.open('output.png') as img:\r\n size = img.size\r\n\r\n if size != (453, 464):\r\n return 1\r\n else:\r\n return 0\r\n\r\nif __name__ == '__main__':\r\n raise SystemExit(main())\r\n```\r\nfinally,\r\n\r\n```bash\r\ngit bisect run python3 check.py\r\n```\r\n\r\nAfter a few steps it yielded this suspicious commit: 8abe308e751a741f2e41c530befd2b99b26a6ac0 (cc @rcomer) which was merged in #28300\n\n### Operating system\n\nUbuntu 22.04\n\n### Matplotlib Version\n\n3.10.0.dev1180+gc2d502d219\n\n### Matplotlib Backend\n\nagg\n\n### Python version\n\n3.13.1\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/jkittner","@type":"Person","name":"jkittner"},"datePublished":"2024-12-27T16:01:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/29381/matplotlib/issues/29381"}
| 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:f68d8321-c8ea-f6af-8633-4615a14f0ebd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D1CC:1C65D6:5501E:7259A:6A5253CB |
| html-safe-nonce | 06a02f141cb71a4b85ca4c0f1019bbc00a3f97b36157abad846dce2a9e03b5c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUNDOjFDNjVENjo1NTAxRTo3MjU5QTo2QTUyNTNDQiIsInZpc2l0b3JfaWQiOiIyNTIyNDM0MTk1OTQwMzMyNDkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c2ae232328dff12fe95ca58ea54ebd2789a31c3e0eec8fb21d1fb0c26922e480 |
| hovercard-subject-tag | issue:2761042940 |
| 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/29381/issue_layout |
| twitter:image | https://opengraph.githubassets.com/91c7b6db3fce35722f636f73eb9300f7ef5c54a7ba63bbde5596ba531ced5934/matplotlib/matplotlib/issues/29381 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/91c7b6db3fce35722f636f73eb9300f7ef5c54a7ba63bbde5596ba531ced5934/matplotlib/matplotlib/issues/29381 |
| og:image:alt | Bug summary When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308 via #28300 Code for reproduc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jkittner |
| 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