Title: [Doc]: Improve legend loc and bbox_to_anchor documentation · Issue #26620 · matplotlib/matplotlib · GitHub
Open Graph Title: [Doc]: Improve legend loc and bbox_to_anchor documentation · Issue #26620 · matplotlib/matplotlib
X Title: [Doc]: Improve legend loc and bbox_to_anchor documentation · Issue #26620 · matplotlib/matplotlib
Description: Documentation Link https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend Problem Inspired by #26612 Legends: Replace confusing terminology like bbox_to_anchor etc, and make the legend pos...
Open Graph Description: Documentation Link https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend Problem Inspired by #26612 Legends: Replace confusing terminology like bbo...
X Description: Documentation Link https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend Problem Inspired by #26612 Legends: Replace confusing terminology like bbo...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26620
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Doc]: Improve legend loc and bbox_to_anchor documentation","articleBody":"### Documentation Link\n\nhttps://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend\n\n### Problem\n\nInspired by #26612\r\n\r\n\u003e 3. [Legends](https://stackoverflow.com/questions/4700614/how-to-put-the-legend-outside-the-plot/43439132#43439132): Replace [confusing terminology](https://stackoverflow.com/questions/25068384/bbox-to-anchor-and-loc-in-matplotlib) like bbox_to_anchor etc, and make the legend positioning simpler\n\n### Suggested improvement\n\n### Parameter *loc*\r\n\r\n- Explicitly state that the locations are positions within a given box (configurable via bbox_to_anchor, default: Axes box)\r\n- Replace\r\n \u003e The strings 'upper left', 'upper right', 'lower left', 'lower right' place the legend at the corresponding corner of the axes.\r\n \u003e The strings 'upper center', 'lower center', 'center left', 'center right' place the legend at the center of the corresponding edge of the axes.\r\n \u003e The string 'center' places the legend at the center of the axes.\r\n\r\n By Add a visual similar to the cheat sheet\r\n \r\n but with the string names in the respective positions.\r\n\r\n### Parameter *bbox_to_anchor*\r\n\r\n- Make it more clear that this is an advanced option for free placement\r\n- Link to https://matplotlib.org/devdocs/users/explain/axes/legend_guide.html#legend-location\r\n- Link to https://matplotlib.org/devdocs/api/figure_api.html#matplotlib.figure.Figure.legend for outside legend (which in former times could only be achieved using bbox_to_anchor), and there make the outside options more prominent.\r\n","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2023-08-29T01:11:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/26620/matplotlib/issues/26620"}
| 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:04126711-44c8-d48b-6e3f-899f54800bbe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80F8:C9E65:10C2E66:164E0F0:6A51C56B |
| html-safe-nonce | 24b5897f54babf7b215ef817375e60e26812ef0ca77adb66dbaa6df87e7781bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEY4OkM5RTY1OjEwQzJFNjY6MTY0RTBGMDo2QTUxQzU2QiIsInZpc2l0b3JfaWQiOiI1OTcyNzE4MDc2NjY1Mzc4MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eda2849a607d3e47d914085854dbf791fa587de2634e7a0f5bbbc23593412e41 |
| hovercard-subject-tag | issue:1870716164 |
| 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/26620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/754215fa0e1cd003ba6d336e2b2b333505a381c90e86b7e36586ff0c43988c8a/matplotlib/matplotlib/issues/26620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/754215fa0e1cd003ba6d336e2b2b333505a381c90e86b7e36586ff0c43988c8a/matplotlib/matplotlib/issues/26620 |
| og:image:alt | Documentation Link https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend Problem Inspired by #26612 Legends: Replace confusing terminology like bbo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| 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