Skip to content

Update lib/matplotlib/stackplot.py #29853

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 7 commits into from
Apr 7, 2025
Merged

Conversation

thedatacurious
Copy link
Contributor

PR summary

Update minimal examples in stackplot.py to improve clarity

PR checklist

Note: Unable to build doc in Github Codespace (already opened issue here)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@timhoffm
Copy link
Member

timhoffm commented Apr 2, 2025

Thanks for the pull request! However, the existing "array-like" is sufficient, see https://numpy.org/doc/2.1/glossary.html#term-array_like. A pandas DataFrame is covered by this. It's not feasible to write out any array-compatible datastructure explicitly.

We would only state DataFrame explicitly if we make use of specific DataFrame features like the index, as long as we only use the column values it's a generic array-like to us.

@timhoffm timhoffm closed this Apr 2, 2025
@story645
Copy link
Member

story645 commented Apr 2, 2025

@timhoffm I talked to @thedatacurious about this PR a bit and it stemmed from a confusion with y b/c stackplot supports both the packed stackplot(x, y=[y1, y2, y3]) and the unpacked form stackplot(x, y1, y2, y3) form.

While this PR may be doing a bit too much in its current form, I think it's fair to be a bit more explicit on allowed inputs.

@timhoffm
Copy link
Member

timhoffm commented Apr 2, 2025

Sure, feel free to reopen and rephrase.

That said, I think we should more clearly specify what array-like means. But that's a separate topic (possibly a glossary entry when we revive that, and/or an :mpl-type: link).

@thedatacurious
Copy link
Contributor Author

thedatacurious commented Apr 4, 2025

@timhoffm Sure, it looks like I don't have permissions to reopen this PR, should I raise a new one?

I have rephrased the edits:
main...thedatacurious:matplotlib:doc-branch)

@jklymak jklymak reopened this Apr 4, 2025
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@thedatacurious thedatacurious requested a review from timhoffm April 4, 2025 23:52
@timhoffm
Copy link
Member

timhoffm commented Apr 4, 2025

Please fix the trailing whitespace as reported by flake8.

@timhoffm timhoffm added this to the v3.10.2 milestone Apr 7, 2025
@timhoffm timhoffm merged commit e8d58af into matplotlib:main Apr 7, 2025
39 of 41 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 7, 2025
timhoffm added a commit that referenced this pull request Apr 7, 2025
…853-on-v3.10.x

Backport PR #29853 on branch v3.10.x (Update lib/matplotlib/stackplot.py)
@ksunden ksunden mentioned this pull request May 9, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants