Skip to content

[ENH] hatch keyword for pie + some pie documentation #24470

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
Jan 11, 2023

Conversation

story645
Copy link
Member

@story645 story645 commented Nov 15, 2022

PR Summary

Added the ability to pass in a list of wedgeproperty dicts, one for each wedge of the pie. Follow on to #2923, would probably address #3134 , inspired by twitter convo

Yes, I know it can be achieved via loop - see the fig comparison test in this PR - but we were already looping over the wedges inside the function to set all the other properties so the major addition is testing if the input is a dict or list of dicts. <- this could possibly be factored into a cbook function, my guess being 'if thing not list wrap in repeat' is not uncommon in the codebase.

Current Iteration

  1. Changed this to a hatch kwarg based on the call, added tests + whats new example.
  2. cleaned up pct/label loc docs from [ENH]: Ability to Swap autopct and label positions #24789, reordered docs to mostly match signature, and added sentence that wedgeprop takes precedence over other parameter setting (in current implementation, seemed sorting this out was out of scope for this PR)
x = [0.3, 0.3, 0.1]
fig, ax = plt.subplots()
ax.pie(x, hatch=['/', '+', '.'])

which would produce roughly

pie

I'll put in a what's new and example if there's consensus on this going in.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).

Documentation

  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@oscargus
Copy link
Member

I think this makes sense!

@oscargus oscargus added this to the v3.7.0 milestone Dec 8, 2022
@story645 story645 changed the title [ENH] Vectorized Wedgeprops argument to pie [ENH] hatch keyword for pie + scatter pie documentation Dec 21, 2022
@story645 story645 changed the title [ENH] hatch keyword for pie + scatter pie documentation [ENH] hatch keyword for pie + some pie documentation Dec 21, 2022
@story645 story645 force-pushed the pie branch 4 times, most recently from 6c6218e to 60f9af8 Compare December 22, 2022 06:30
@story645 story645 force-pushed the pie branch 3 times, most recently from a74fa53 to 7b7c8fa Compare December 22, 2022 21:07
@story645 story645 force-pushed the pie branch 2 times, most recently from 625d2e6 to 520480b Compare January 8, 2023 02:21
@story645
Copy link
Member Author

story645 commented Jan 8, 2023

I don't think the failing tests are connected to this PR 😟

@QuLogic
Copy link
Member

QuLogic commented Jan 10, 2023

Test failures are unrelated.

@story645
Copy link
Member Author

I wrote alt text for the what's new entry here but should I just put that as a follow up so this doesn't go through another round of reviews?

@QuLogic
Copy link
Member

QuLogic commented Jan 10, 2023

You can add it here if you want to update and get #24921 in to fix CI.

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Looks good - just one question, which is either a quick fix or I'm missing something. Either way happy for this to be merged once it's been considered!

reworded pctdistance and labeldistance b/c of matplotlib#24789

Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Co-authored-by: sledziu32 <sledziu32@gmail.com>
Co-authored-by: Jody Klymak <jklymak@gmail.com>
@jklymak jklymak merged commit a483e85 into matplotlib:main Jan 11, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 11, 2023
@story645 story645 deleted the pie branch January 11, 2023 01:04
QuLogic added a commit that referenced this pull request Jan 11, 2023
…470-on-v3.7.x

Backport PR #24470 on branch v3.7.x ([ENH] hatch keyword for pie + some pie documentation)
@ksunden ksunden mentioned this pull request Feb 20, 2023
6 tasks
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.

6 participants