Skip to content
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

pie chart is trimmed #2518

Closed
koch-mate opened this issue Oct 14, 2013 · 3 comments · Fixed by #2952
Closed

pie chart is trimmed #2518

koch-mate opened this issue Oct 14, 2013 · 3 comments · Fixed by #2952
Milestone

Comments

@koch-mate
Copy link

I'm pretty new to matplotlib, and asked a question on StackOverflow where they suggested me to report my issue as a bug. Please see the relevant thread with images: http://stackoverflow.com/questions/19347453/matplotlib-savefig-trims-the-graph

@WeatherGod
Copy link
Member

Looks like the bug is that the shadows are not accounted for when
autoscaling. This is probably because of how the shadows are implemented
(iirc, they are an agg transform). The fix is probably to 1) add a bit of
padding when shadow=True or 2) make sure that clipping is turned off for
the polygons. (1) would work fine until it is time to use
bbox_inches='tight' as it probably wouldn't know about the shadows, while
(2) would look weird if one pans/zooms.

The reason the text looks fine is because they are explicitly set to have
clipping turned off, which would lend credence to having the shadow and the
pie polygons to have their clippings turned off as well.

@koch-mate
Copy link
Author

Yes, and that's why set_clip_on(False) worked for me and solved the problem.

I'm fine with this solution, if you don't this is a bug in the lib which should be fixed later, feel free to close this report.

@tacaswell
Copy link
Member

As long as the shadows are entirely inside the axes (which get_visible() should still return True on, even if all it's visible pieces are hidden) the pie-chart will be protected from the bbox_inchs='tight'.

It isn't an issue with auto-scaling, the axes limits are hard coded in axes.pie.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Apr 3, 2014
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Apr 17, 2014
 - set default value of `clip_on` in *prop dicts
 - closes matplotlib#2518
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Apr 27, 2014
 - set default value of `clip_on` in *prop dicts
 - closes matplotlib#2518
tacaswell added a commit to tacaswell/matplotlib that referenced this issue May 14, 2014
 - set default value of `clip_on` in *prop dicts
 - closes matplotlib#2518
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jun 5, 2014
 - set default value of `clip_on` in *prop dicts
 - closes matplotlib#2518
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 a pull request may close this issue.

3 participants