Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Allow option to display absolute values for pie chart #19338#25757
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chart#19338Added a paramter wedgelabels to the pie() so the user can choose ifthey values are absolute or percentages. Renamed autopct withwedgelabelsfmt as the user requested.
There was a problem hiding this 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 while, please feel free to ping@matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
oscargus left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for this!
It is not clear to me how this works in practice. Right now, bothautofmt
andwedgelabelsfmt
does the same thing? If so, why should we have both? If not, how can we deprecateautofmt
later?
If it is only a matter of a "bad" name, then I think it is better to just have one name and use the decorator@_api.rename_parameter("3.8", "autofmt", "wedgelabelsfmt")
.
However, I would wait for additional input before going all in on these changes. (New arguments after*
is a requirement though.)
Edit: after reading the issue, I think it should be quite OK to add the decorator as well.
wedgeprops=None, textprops=None, center=(0, 0), | ||
autopct=None,wedgelabels=None, wedgelabelsfmt=None, pctdistance=0.6, | ||
shadow=False, labeldistance=1.1, startangle=0, radius=1, | ||
counterclock=True,wedgeprops=None, textprops=None, center=(0, 0), | ||
frame=False, rotatelabels=False, *, normalize=True, hatch=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The new arguments must be added after the*
in case someone is using positional arguments.
I get the need and support supporting it, but I'm very iffy on coupled keywords - (wedgelabels, wedgelabelfmt) and would prefer an 'absolutefmt' keyword w/ the instruction that you cannot use both. Either way, I think wedgelabels is confusing cause labels is also confusing and we're really labeling the categories and amounts (maybe intertior labels?) And, as mentioned in the checklist, once settled this will need an example (I suggest adding it to the pie demo). |
Hi@codebreakymefix are you still interested in working in this? It looks like maybe you were waiting for reviewers to reach a consensus. I think I agree with@story645 on this that the proposedwedgelabels could be confusing. As thepie example shows, the currentlabels can be put on the wedge and the automatic percentage labels outside. Perhapsautolabels andautolabelfmt rather thanwedge… might work? Or I also like@story645’s suggestion of an “absolute” format keyword that can’t be passed together withautopct. |
Discussion on parameter name also needs to consider thepctdistance parameter. |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
Adds a parameter 'wedgelabels' to pie() for the user to display absolute or percent values in the wedges. Renamed 'autopct' to "wedgelabelsfmt" as the user requested.
closes#19338
PR Checklist
Linked Issue
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst