Skip to content

Make example in legend_elements doc more generalisable #27846

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Mar 3, 2024

PR summary

Fixes #27826 - I'm guessing the author of that issue copied the example in the docstring, and then found it didn't work for large values. Since the text says "creates three legend elements, one for each color" I think it makes sense to put the num=None kwarg here to make sure "one for each color" remains true for larger data sizes.

PR checklist

@dstansby dstansby added the Documentation: API files in lib/ and doc/api label Mar 3, 2024
@github-actions github-actions bot added topic: collections and mappables and removed Documentation: API files in lib/ and doc/api labels Mar 3, 2024
Copy link
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

Anyone can merge on green.

@rcomer rcomer added this to the v3.8.4 milestone Mar 3, 2024
@rcomer rcomer added the Documentation: API files in lib/ and doc/api label Mar 3, 2024
@rcomer
Copy link
Member

rcomer commented Mar 3, 2024

@dstansby should #27826 be linked here? Or is there more you think we should do for that?

@dstansby
Copy link
Member Author

dstansby commented Mar 3, 2024

I mentioned it it the comment at the top of this PR, but I think this is probably enough to close that PR. I'll update the comment at the top to link it.

@rcomer
Copy link
Member

rcomer commented Mar 3, 2024

Azure failure is clearly unrelated.

@rcomer rcomer merged commit a7d0677 into matplotlib:main Mar 3, 2024
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 3, 2024
rcomer added a commit that referenced this pull request Mar 3, 2024
…846-on-v3.8.x

Backport PR #27846 on branch v3.8.x (Make example in legend_elements doc more generalisable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unexpected behavior of scatter.legend_elements
2 participants