From e25f9f75622c79d8c5874be266b9bab2d669f5d9 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Mon, 14 Jan 2019 16:44:45 -0800 Subject: [PATCH 1/3] FIX: bar mixed units, allow ValueError as well FIX: make exception in bar for convert(x+dx) more liberal --- lib/matplotlib/axes/_axes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 1830ef5309fe..e4c3b0fa0237 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2057,9 +2057,9 @@ def _convert_dx(dx, x0, xconv, convert): dx = [convert(x0 + ddx) - x for ddx in dx] if delist: dx = dx[0] - except (TypeError, AttributeError) as e: - # but doesn't work for 'string' + float, so just - # see if the converter works on the float. + except Exception: + # if the above fails (for any reason) just fallback to what + # we do by default and convert dx by iteslf. dx = convert(dx) return dx From aa0cf874053484c2a2838af10d4157a2beea0a30 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 19 Jan 2019 09:47:32 -0800 Subject: [PATCH 2/3] FIX: makee exception tighter --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index e4c3b0fa0237..061ddde2e0c3 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2057,7 +2057,7 @@ def _convert_dx(dx, x0, xconv, convert): dx = [convert(x0 + ddx) - x for ddx in dx] if delist: dx = dx[0] - except Exception: + except (ValueEerror, TypeError, AttributeError): # if the above fails (for any reason) just fallback to what # we do by default and convert dx by iteslf. dx = convert(dx) From dd2278105aa33f4461858ea63037fa56486b9846 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sun, 20 Jan 2019 16:02:16 -0800 Subject: [PATCH 3/3] Fix small typo --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 061ddde2e0c3..7c1db6be21c0 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2057,7 +2057,7 @@ def _convert_dx(dx, x0, xconv, convert): dx = [convert(x0 + ddx) - x for ddx in dx] if delist: dx = dx[0] - except (ValueEerror, TypeError, AttributeError): + except (ValueError, TypeError, AttributeError): # if the above fails (for any reason) just fallback to what # we do by default and convert dx by iteslf. dx = convert(dx)