Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbb519c

Browse files
author
James Evans
committed
Fixed a comparison in update_patch_limits that compared data with being equall to zero. This will fail with unitized data.
svn path=/trunk/matplotlib/; revision=7824
1 parent 608f702 commit cbb519c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,9 @@ def _update_patch_limits(self, patch):
14441444
# scaling. We'll ignore rects with zero height or width in
14451445
# the auto-scaling
14461446

1447+
# cannot check for '==0' since unitized data may not compare to zero
14471448
if (isinstance(patch, mpatches.Rectangle) and
1448-
(patch.get_width()==0 or patch.get_height()==0)):
1449+
((not patch.get_width()) or (notpatch.get_height()))):
14491450
return
14501451
vertices = patch.get_path().vertices
14511452
if vertices.size > 0:

0 commit comments

Comments
 (0)