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

improve legend docstring#9999

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
jklymak merged 1 commit intomatplotlib:masterfromtimhoffm:doc-legend
Dec 18, 2017
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

This improves the legend docstrings:

  • describe handles and labels
  • add call signatures toAxes.legend()
  • Structure and reorderAxes.legend() so that the most common use case is at the top.

alsofixes#8668

@timhoffm
Copy link
MemberAuthor

Just saw the failing test, which compares if the parameter sections are identical foraxes.legend() andLegend().

I assume the intent is to keep the long parameter lists at sync. However since the signatures are actually different, this does not work easily. Either one has to break with the documenting rules and exclude parent, handles and labels from the parameter sections (probably why the docstring was in the peculiar state before I changed it), or one has to refine the test.

How should I proceed?

@jklymak
Copy link
Member

Without looking too closely, can you keep "Parameters" as the arguments that change, and "Other Paramters" as the parameters that are shared and move the test to look at the "Other Parameters" section?

The problem before was that the very very very long list of kwargs was not consistent between the legend docstrings. I fixed that, and then introduced the test (#9324). If it had been up to me, we'd have used a doc interp, but the consensus seemed to be that we don't like doc interps. I'm not particularly happy w/ the existing solution, so other creative ideas more than welcome. I'm not going to be terribly upset if we get rid of the test for consistency, but there should be a way to keep the kwarg documentation consistent between the threelegends. See also#9414.

@timhoffm
Copy link
MemberAuthor

The workaround with "Other Parameters" should be ok in this case. Will look into it.

As of syncing docstrings, you just have the two options:

  • Sync manually and monitor deviations (--> current tests).
  • Any automatic mechanism at build or import-time.

I currently do not oversee the subtleties of the latter, and therefore, cannot comment here.

@timhoffm
Copy link
MemberAuthor

Docstring / test adapted.

@jklymak
Copy link
Member

Test passed; you've got.legend in there somewhere, and its ambiguous betweenFigure.legend andaxes.legend.

ax.legend()

Specific lines can be excluded from the automatic legend element
selection by defining a label starting with an underscore.
This is default for all artists, so calling :meth:`legend` without
This is default for all artists, so calling :meth:`.legend` without
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs to me.Axes.legend I think

@jklymakjklymak merged commit7231bd3 intomatplotlib:masterDec 18, 2017
@QuLogicQuLogic added this to thev2.2 milestoneDec 18, 2017
@timhoffmtimhoffm deleted the doc-legend branchJanuary 3, 2018 16:47
@QuLogicQuLogic modified the milestones:needs sorting,v2.2.0Feb 12, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.2.0
Development

Successfully merging this pull request may close these issues.

handles keyword argument not documented in the help of legend
4 participants
@timhoffm@jklymak@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp