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 pie chart in demo_agg_filter.py#24261

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
QuLogic merged 2 commits intomatplotlib:mainfromleejjoon:fix_demo_agg_filter
Oct 25, 2022

Conversation

leejjoon
Copy link
Contributor

PR Summary

This fixes the pie chart in [demo_agg_filter.py] (https://matplotlib.org/stable/gallery/misc/demo_agg_filter.html) which is incorrectly displayed with simple black color . Fixed image is shown below. It also add newshrink parameter and a bit of more documentation.

image

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@oscargusoscargus added this to thev3.6-doc milestoneOct 24, 2022
@ksunden
Copy link
Member

The implementation ofshrink relies onscipy, which I do not believe we want to make a dependency for building the docs.

See, for example, thedouble pendulum example which implements the code in python rather than using a scipy method which would provide better results.

@oscargus
Copy link
Member

Good observation! (Should probably not approve stuff with a heavy cold...)

It would be great to get rid of the scipy dependency.

@leejjoon
Copy link
ContributorAuthor

The implementation ofshrink relies onscipy, which I do not believe we want to make a dependency for building the docs.

Would it be okay if the example uses "shrink=None" so that importing scipy is bypassed?
I think theshrink option gives a more pleasing result, and it would be good if we can let the users play with it.
If this is not acceptable, I can simply remove the shrink option and its dependency on scipy.

@tacaswell
Copy link
Member

Welcome back@leejjoon !

@ksunden
Copy link
Member

I think the effect you are looking for can be had with library-native changes to theexplode parameter rather than passing throughscipy.ndimage.

Figure_1

Here is a quick example demonstrating the differences between the example as is (with your fixes so that it works, but withoutshrink, with your shrink implementation and with noshrink, but a uniform0.1 forexplode rather than(0, 0.05, 0, 0)

@leejjoon
Copy link
ContributorAuthor

Okay, I have removed shrink parameter so the scipy dependency. However, I still think that it would be good to have ashrink parameter as it offers a rather general solution not specific to pie chart.

I also have rebased the PR to the current main and force-pushed it.

@leejjoon
Copy link
ContributorAuthor

Welcome back@leejjoon !

Thanks!

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

@QuLogicQuLogic modified the milestones:v3.6-doc,v3.6.2Oct 25, 2022
@QuLogicQuLogic merged commit96e69ed intomatplotlib:mainOct 25, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 25, 2022
@leejjoonleejjoon deleted the fix_demo_agg_filter branchOctober 25, 2022 06:26
oscargus added a commit that referenced this pull requestOct 25, 2022
…261-on-v3.6.xBackport PR#24261 on branch v3.6.x (Fix pie chart in demo_agg_filter.py)
melissawm pushed a commit to melissawm/matplotlib that referenced this pull requestDec 19, 2022
* fix demo_agg_filter.py* Update examples/misc/demo_agg_filter.pyCo-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@oscargusoscargusoscargus approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.2
Development

Successfully merging this pull request may close these issues.

5 participants
@leejjoon@ksunden@oscargus@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp