Title: [Bug]: Legend with location set to ‘best’ overlaps with the title when the titles is moved down · Issue #29319 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Legend with location set to ‘best’ overlaps with the title when the titles is moved down · Issue #29319 · matplotlib/matplotlib
X Title: [Bug]: Legend with location set to ‘best’ overlaps with the title when the titles is moved down · Issue #29319 · matplotlib/matplotlib
Description: Bug summary If I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to best, the legend overlaps with the title. Code for reproduction import matplotlib.pyplot as plt plt.close('all') plt.plot((1,...
Open Graph Description: Bug summary If I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to best, the legend overlaps with the title. Code for reproduction import matplotlib.pyp...
X Description: Bug summary If I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to best, the legend overlaps with the title. Code for reproduction import matplotlib.pyp...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29319
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Legend with location set to ‘best’ overlaps with the title when the titles is moved down","articleBody":"### Bug summary\n\nIf I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to `best`, the legend overlaps with the title.\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\r\n\r\nplt.close('all')\r\nplt.plot((1,2,3), label='Just a very long legend')\r\nplt.title('Just a very long title 1234567890', y=0.9)\r\nplt.legend(loc='best')\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nI expect the legend to be placed in a location that does not overlap with the title.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nLinux\n\n### Matplotlib Version\n\n3.9.4\n\n### Matplotlib Backend\n\nqtagg\n\n### Python version\n\n3.12.7\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/aweinstein","@type":"Person","name":"aweinstein"},"datePublished":"2024-12-16T08:25:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/29319/matplotlib/issues/29319"}
| 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:fb103465-fcb9-9e8b-1d9b-d926fbc1bbff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A18E:20E645:2A6680:3979C6:6A52285A |
| html-safe-nonce | 22a97efa6ea46ff911ee4c584cd698de27c82c8c544946287f9ae0066371720b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMThFOjIwRTY0NToyQTY2ODA6Mzk3OUM2OjZBNTIyODVBIiwidmlzaXRvcl9pZCI6IjYxNjYxMjc0NDMwNDIyNDg3OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6616476fcb5461332976d81ab6c24499628b97fa4e121408c9c39b4e174f76ea |
| hovercard-subject-tag | issue:2741669348 |
| 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/29319/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd9ead9bc08ce4a03b3c865c1c6cec8dbbc629a52c543c75c24fd7ec9649e002/matplotlib/matplotlib/issues/29319 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd9ead9bc08ce4a03b3c865c1c6cec8dbbc629a52c543c75c24fd7ec9649e002/matplotlib/matplotlib/issues/29319 |
| og:image:alt | Bug summary If I adjust the y-position of a plot title to move it down, and then I add a legend with loc set to best, the legend overlaps with the title. Code for reproduction import matplotlib.pyp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aweinstein |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width