| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
We could be slightly more explicit by using plt.figlegend in the replace |
Sorry, something went wrong.
…434-on-v3.6.x Backport PR #24434 on branch v3.6.x (Fix pyplot.figlegend docstring)
| Back | FazBrowse Home | New Git URL |
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
Documentation
Release Notes