Title: Fix pyplot.figlegend docstring by ksunden · Pull Request #24434 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix pyplot.figlegend docstring by ksunden · Pull Request #24434 · matplotlib/matplotlib
X Title: Fix pyplot.figlegend docstring by ksunden · Pull Request #24434 · matplotlib/matplotlib
Description: Closes #24433 PR Summary The method name for Figure.legend in pyplot is figlegend due to a name collision. As such, a .replace call is used to translate the docstring from the one written for Figure.legend to make sense for users interacting with plt.figlegend. This behavior was originally introduced in #11975, using legend( alone (with no dotted name). The docstring was updated in #18106, with additional examples that used fig.legend( in additional examples. These new examples were caught by the replace and became fig.figlegend(. This PR makes all calls fig.legend and simply removes the dot for the replace call. This leads to some slightly incongrous examples which are using the object based api to call ax.plot but following that with figlegend from pyplot. (not wrong per se, but mixing APIs) This was chosen as a compromise to allow the docstring to have one cannonical form, while still using the method name where help is called. PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation Documentation is sphinx and numpydoc compliant (the docs should build without error). New plotting related features are documented with examples. Release Notes New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/ API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/ Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst
Open Graph Description: Closes #24433 PR Summary The method name for Figure.legend in pyplot is figlegend due to a name collision. As such, a .replace call is used to translate the docstring from the one written for Figur...
X Description: Closes #24433 PR Summary The method name for Figure.legend in pyplot is figlegend due to a name collision. As such, a .replace call is used to translate the docstring from the one written for Figur...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/24434
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:15eb78f8-52fd-e1fc-ea28-785008d0a48b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D064:9EFA3:3E3A96:53468B:6A5191CB |
| html-safe-nonce | 58186a1d9a865b1985e639a80dfd79ac3307dc84490bd602b7ad7f667d4f1b42 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDY0OjlFRkEzOjNFM0E5Njo1MzQ2OEI6NkE1MTkxQ0IiLCJ2aXNpdG9yX2lkIjoiMjU4ODE4NDYwMDQzOTI2MzY5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1e3d931d678cbaa253784de741950e1024c405e14426203e0a006eea39f538aa |
| hovercard-subject-tag | pull_request:1119820194 |
| 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/24434/files |
| twitter:image | https://avatars.githubusercontent.com/u/2501846?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2501846?s=400&v=4 |
| og:image:alt | Closes #24433 PR Summary The method name for Figure.legend in pyplot is figlegend due to a name collision. As such, a .replace call is used to translate the docstring from the one written for Figur... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width