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

Reorder kwonly kwargs in Colorbar & related docs.#29652

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:mainfromanntzer:cbd
Feb 22, 2025

Conversation

anntzer
Copy link
Contributor

Move "redundant" kwargs (cmap/norm can be specified via mappable; orientation/ticklocation can be specified via location) to the end of the kwarg list and under an "Other Parameters" section.

Also remove mention of Normalize(clip=False);

imshow(rand(10, 10),       cmap=mpl.colormaps["viridis"].with_extremes(under="w", over="k"))colorbar(extend="both")

seems enough to have over/under colors show up, i.e. no need to fiddle with the clip parameter.

PR summary

PR checklist

Move "redundant" kwargs (cmap/norm can be specified via mappable;orientation/ticklocation can be specified via location) to the end ofthe kwarg list and under an "Other Parameters" section.Also remove mention of Normalize(clip=False);    imshow(rand(10, 10),           cmap=mpl.colormaps["viridis"].with_extremes(under="w", over="k"))    colorbar(extend="both")seems enough to have over/under colors show up, i.e. no need to fiddlewith the clip parameter.
Comment on lines +247 to +248
Other Parameters
----------------
Copy link
Member

@timhoffmtimhoffmFeb 21, 2025
edited
Loading

Choose a reason for hiding this comment

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

It seems like numpydoc is placing theAttributes section betweenParameters andOther Parameters, which I find quite confusing.

grafik

I propose not useOther Parameters then here.

Edit: This is an intentional change in numpydoc 1.8 (numpy/numpydoc#571), though I'm not clear whether this effect was considered.

We can work around this by moving the parameters to the__init__ docstring, because that seems to be appended below the class docstring, see e.g.https://matplotlib.org/devdocs/api/widgets_api.html#matplotlib.widgets.Button. In a quick check, this seems to be a pattern we generally use.

anntzer reacted with thumbs up emoji
Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

I'll merge this as is and do a follow-up to move the parameters to theinit docstring. That's logically simpler than reordering and moving at the same time.

@timhoffmtimhoffm added this to thev3.10.1 milestoneFeb 22, 2025
@timhoffmtimhoffm merged commitefde717 intomatplotlib:mainFeb 22, 2025
48 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestFeb 22, 2025
timhoffm added a commit to timhoffm/matplotlib that referenced this pull requestFeb 22, 2025
This prevents numpydoc from inserting Attributes between Parameters andOther Parameters see https://github.com/matplotlib/pull/29652#pullrequestreview-2634087106.It's also a pattern we generally use.
@anntzeranntzer deleted the cbd branchFebruary 22, 2025 09:20
timhoffm added a commit that referenced this pull requestFeb 22, 2025
…652-on-v3.10.xBackport PR#29652 on branch v3.10.x (Reorder kwonly kwargs in Colorbar & related docs.)
@ksundenksunden mentioned this pull requestMar 3, 2025
5 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.10.1
Development

Successfully merging this pull request may close these issues.

2 participants
@anntzer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp