Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix pyplot.figlegend docstring#24434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:mainfromksunden:figlegend_plt
Nov 15, 2022
Merged

Conversation

ksunden
Copy link
Member

Closes#24433

PR Summary

The method name forFigure.legend inpyplot isfiglegend due to a name collision.
As such, a.replace call is used to translate the docstring from the one written forFigure.legend to make sense for users interacting withplt.figlegend.

This behavior was originally introduced in#11975, usinglegend( alone (with no dotted name).

The docstring was updated in#18106, with additional examples that usedfig.legend( in additional examples.
These new examples were caught by the replace and becamefig.figlegend(.

This PR makes all callsfig.legend and simply removes the dot for the replace call.
This leads to someslightly incongrous examples which are using the object based api to callax.plot but following that withfiglegend frompyplot. (notwrong 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 wherehelp is called.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild 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 indoc/users/next_whats_new/
  • API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

@ksunden
Copy link
MemberAuthor

Wecould be slightly more explicit by usingplt.figlegend in the replace

@timhoffmtimhoffm added this to thev3.6.3 milestoneNov 15, 2022
@timhoffmtimhoffm merged commitd09526f intomatplotlib:mainNov 15, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestNov 15, 2022
@ksundenksunden deleted the figlegend_plt branchNovember 15, 2022 07:54
QuLogic added a commit that referenced this pull requestNov 15, 2022
…434-on-v3.6.xBackport PR#24434 on branch v3.6.x (Fix pyplot.figlegend docstring)
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.3
Development

Successfully merging this pull request may close these issues.

[Doc]: figlegend examples callfig.figlegend instead ofplt.figlegend orfig.legend
3 participants
@ksunden@timhoffm@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp