Title: Update ax.legend input types by rcomer · Pull Request #27535 · matplotlib/matplotlib · GitHub
Open Graph Title: Update ax.legend input types by rcomer · Pull Request #27535 · matplotlib/matplotlib
X Title: Update ax.legend input types by rcomer · Pull Request #27535 · matplotlib/matplotlib
Description: PR summary Closes #27507 by changing the annotations for handles and labels to Iterable, as requested. In addition to the discussion there, I just realised we already have it like this for fig.legend matplotlib/lib/matplotlib/figure.pyi Lines 129 to 133 in 2e95cf2 def legend(self, handles: Iterable[Artist], labels: Iterable[str], **kwargs) -> Legend: ... @overload def legend(self, *, handles: Iterable[Artist], **kwargs) -> Legend: ... @overload def legend(self, labels: Iterable[str], **kwargs) -> Legend: ... Also changes the handles type to list in the ax.legend docstring, following the guidelines. This is now consistent with the labels type in this docstring and with the fig.legend docstring. PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: PR summary Closes #27507 by changing the annotations for handles and labels to Iterable, as requested. In addition to the discussion there, I just realised we already have it like this for fig.le...
X Description: PR summary Closes #27507 by changing the annotations for handles and labels to Iterable, as requested. In addition to the discussion there, I just realised we already have it like this for fig.le...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/27535
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4eda6cba-625c-65e0-c5c8-83a799653a00 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 969A:3372C3:F8BF8A:1520F66:6A55681B |
| html-safe-nonce | cb49c5a78a5de2bc2918621dd939c8fa6906780f6ff81252dfdd7fc9a1d974ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjlBOjMzNzJDMzpGOEJGOEE6MTUyMEY2Njo2QTU1NjgxQiIsInZpc2l0b3JfaWQiOiI1MjY1NTQyOTkyNTk3NzUwMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f1ffe0ba9118bb34b9e354c35304497abf2bbcb02be7002672c45fbcae2bf5b1 |
| hovercard-subject-tag | pull_request:1647417490 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/27535/files |
| twitter:image | https://avatars.githubusercontent.com/u/10599679?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/10599679?s=400&v=4 |
| og:image:alt | PR summary Closes #27507 by changing the annotations for handles and labels to Iterable, as requested. In addition to the discussion there, I just realised we already have it like this for fig.le... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8201d0b7bc32164c4662de52242e463a356df543 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width