Skip to content

pie chart is trimmed #2518

Closed
Closed

Description

@koch-mate

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

Activity

  1. WeatherGod commented on Oct 14, 2013

    @WeatherGod
    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.

  2. koch-mate commented on Oct 14, 2013

    @koch-mate
    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.

  3. tacaswell commented on Oct 14, 2013

    @tacaswell
    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.

  4. added a commit that references this issue on Apr 3, 2014
    d01c7a7
  5. added a commit that references this issue on Apr 17, 2014
    47d7f8a
  6. added a commit that references this issue on Apr 27, 2014
    225a7fc
  7. added a commit that references this issue on May 14, 2014
    fc2b52b
  8. added a commit that references this issue on Jun 5, 2014
    89d8ac8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions