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 passing singleton sequence-type styles to hist#29719

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
story645 merged 1 commit intomatplotlib:mainfromrcomer:hist-styles
Mar 12, 2025

Conversation

rcomer
Copy link
Member

@rcomerrcomer commentedMar 8, 2025
edited
Loading

PR summary

Fixes#29717. Use ofnp.atleast_1d here is not appropriate for style properties expressed as tuples or array-likes. For colours we can just useto_rgba_array. For linestyles I factored out the logic used to set one or more linestyles inCollection.

We are already usingto_rgba_array ifcolors is passed:

else:
colors=mcolors.to_rgba_array(color)

PR checklist

@rcomerrcomer added the PR: bugfixPull requests that fix identified bugs labelMar 8, 2025
@rcomer
Copy link
MemberAuthor

OK so we can't just useto_rgba_array if the colour is "none", which doesn't happen in the tests but does in the docs...

@rcomerrcomer closed thisMar 8, 2025
@rcomerrcomer deleted the hist-styles branchMarch 8, 2025 18:45
@rcomerrcomer restored the hist-styles branchMarch 8, 2025 18:46
@rcomerrcomer reopened thisMar 8, 2025
@story645
Copy link
Member

OK so we can't just use to_rgba_array if the colour is "none",

Is this related to#28475?

@rcomer
Copy link
MemberAuthor

OK so we can't just use to_rgba_array if the colour is "none",

Is this related to#28475?

Yes exactly. The array has zero size, so you get aStopIteration error when you try to callnext.

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 have been pondering for a time whether we should have an internal helper to loop over possibly list-type properties. This should take care of all the technical details like single value vs. list of values, properly handling sequence-like single values, optionally length checks (we currently don't have a clear policy whether we request the same size, or whether we are permissive and continuously cycle as long as needed, which may be handy in some cases but could hide a bug in others).

story645 and rcomer reacted with thumbs up emoji
@rcomerrcomer added this to thev3.10.2 milestoneMar 11, 2025
@story645story645 merged commit4b68626 intomatplotlib:mainMar 12, 2025
55 of 65 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestMar 12, 2025
story645 added a commit that referenced this pull requestMar 12, 2025
…719-on-v3.10.xBackport PR#29719 on branch v3.10.x (Fix passing singleton sequence-type styles to hist)
@rcomerrcomer deleted the hist-styles branchMarch 12, 2025 10:27
@ksundenksunden mentioned this pull requestMay 9, 2025
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@story645story645story645 approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
PR: bugfixPull requests that fix identified bugstopic: collections and mappables
Projects
None yet
Milestone
v3.10.3
Development

Successfully merging this pull request may close these issues.

[Bug]: Using a linestyle tuple with a histogram crashes with matplotlib 3.10
3 participants
@rcomer@story645@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp