Skip to content

#2150 Updating patch limits if either width or height is non zero: Issue 2150 #2942

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2014-03-30 Changed the behaviour of axes to not ignore leading or trailing
patches of height 0 (or width 0) while calculating the x and y
axis limits. Patches having both height == 0 and width == 0 are
ignored.

2014-03-27 Added tests for pie ccw parameter. Removed pdf and svg images
from tests for pie linewidth parameter.

Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1545,8 +1545,10 @@ def _update_patch_limits(self, patch):
# the auto-scaling

# cannot check for '==0' since unitized data may not compare to zero
# issue #2150 - we update the limits if patch has non zero width
# or height.
if (isinstance(patch, mpatches.Rectangle) and
((not patch.get_width()) or (not patch.get_height()))):
((not patch.get_width()) and (not patch.get_height()))):
return
vertices = patch.get_path().vertices
if vertices.size > 0:
Expand Down