From ac2db8edb4b40c22b9635548a7d1317b9b950524 Mon Sep 17 00:00:00 2001 From: sfroid Date: Tue, 25 Mar 2014 11:21:35 -0700 Subject: [PATCH 1/3] #2150 work in progress. Patch limits get updated even if width or height of a patch might be 0 (but not if both width and height are 0). --- CHANGELOG | 3 +++ lib/matplotlib/axes/_base.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e521a8815286..2ad6dfc4a95b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2014-03-24 Changed the behaviour of axes to not ignore leading or trailing + patches of height 0 while calculating the x and y axis limits. + 2014-03-17 Bug was fixed in append_axes from the AxesDivider class would not append axes in the right location with respect to the reference locator axes diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 87b3815e8d87..aba264e756c8 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -1546,7 +1546,7 @@ def _update_patch_limits(self, patch): # cannot check for '==0' since unitized data may not compare to zero 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: From dc64e38be8dd32ba4f8c3990823624408dba005f Mon Sep 17 00:00:00 2001 From: sfroid Date: Fri, 28 Mar 2014 11:57:30 -0700 Subject: [PATCH 2/3] #2150 wip - added change log --- CHANGELOG | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2ad6dfc4a95b..6ebee87bb60a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ 2014-03-24 Changed the behaviour of axes to not ignore leading or trailing - patches of height 0 while calculating the x and y axis limits. + 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-17 Bug was fixed in append_axes from the AxesDivider class would not append axes in the right location with respect to the reference From c02f5118b3e7a80403e744f83146971c1d9d4aa0 Mon Sep 17 00:00:00 2001 From: sfroid Date: Sun, 30 Mar 2014 00:51:58 -0700 Subject: [PATCH 3/3] #2150 updating comments --- lib/matplotlib/axes/_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index aba264e756c8..12eb99fb0cdc 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -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()) and (not patch.get_height()))): + ((not patch.get_width()) and (not patch.get_height()))): return vertices = patch.get_path().vertices if vertices.size > 0: