| |
@@ -0,0 +1,68 @@
|
| |
+ commit 4651a1253ca5dc597550c5cd746f30dabee770bc
|
| |
+ Author: Jody Klymak <jklymak@gmail.com>
|
| |
+ Date: Wed Sep 4 10:48:01 2019 -0700
|
| |
+
|
| |
+ Backport PR #15168: MNT: explicitly cast np.bool_ -> bool to prevent deprecation warning
|
| |
+
|
| |
+ diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py
|
| |
+ index ff5aaf032..c2a4d2f42 100644
|
| |
+ --- a/lib/matplotlib/axes/_base.py
|
| |
+ +++ b/lib/matplotlib/axes/_base.py
|
| |
+ @@ -3267,7 +3267,8 @@ class _AxesBase(martist.Artist):
|
| |
+ reverse = left > right
|
| |
+ left, right = self.xaxis.get_major_locator().nonsingular(left, right)
|
| |
+ left, right = self.xaxis.limit_range_for_scale(left, right)
|
| |
+ - left, right = sorted([left, right], reverse=reverse)
|
| |
+ + # cast to bool to avoid bad interaction between python 3.8 and np.bool_
|
| |
+ + left, right = sorted([left, right], reverse=bool(reverse))
|
| |
+
|
| |
+ self.viewLim.intervalx = (left, right)
|
| |
+ if auto is not None:
|
| |
+ @@ -3649,7 +3650,8 @@ class _AxesBase(martist.Artist):
|
| |
+ reverse = bottom > top
|
| |
+ bottom, top = self.yaxis.get_major_locator().nonsingular(bottom, top)
|
| |
+ bottom, top = self.yaxis.limit_range_for_scale(bottom, top)
|
| |
+ - bottom, top = sorted([bottom, top], reverse=reverse)
|
| |
+ + # cast to bool to avoid bad interaction between python 3.8 and np.bool_
|
| |
+ + bottom, top = sorted([bottom, top], reverse=bool(reverse))
|
| |
+
|
| |
+ self.viewLim.intervaly = (bottom, top)
|
| |
+ if auto is not None:
|
| |
+ diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py
|
| |
+ index a4cdffc55..e23b5748c 100644
|
| |
+ --- a/lib/matplotlib/axis.py
|
| |
+ +++ b/lib/matplotlib/axis.py
|
| |
+ @@ -2156,7 +2156,8 @@ class XAxis(Axis):
|
| |
+ def set_inverted(self, inverted):
|
| |
+ # docstring inherited
|
| |
+ a, b = self.get_view_interval()
|
| |
+ - self.axes.set_xlim(sorted((a, b), reverse=inverted), auto=None)
|
| |
+ + # cast to bool to avoid bad interaction between python 3.8 and np.bool_
|
| |
+ + self.axes.set_xlim(sorted((a, b), reverse=bool(inverted)), auto=None)
|
| |
+
|
| |
+ def set_default_intervals(self):
|
| |
+ # docstring inherited
|
| |
+ @@ -2463,7 +2464,8 @@ class YAxis(Axis):
|
| |
+ def set_inverted(self, inverted):
|
| |
+ # docstring inherited
|
| |
+ a, b = self.get_view_interval()
|
| |
+ - self.axes.set_ylim(sorted((a, b), reverse=inverted), auto=None)
|
| |
+ + # cast to bool to avoid bad interaction between python 3.8 and np.bool_
|
| |
+ + self.axes.set_ylim(sorted((a, b), reverse=bool(inverted)), auto=None)
|
| |
+
|
| |
+ def set_default_intervals(self):
|
| |
+ # docstring inherited
|
| |
+ diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py
|
| |
+ index 4202be9a1..047234b36 100644
|
| |
+ --- a/lib/mpl_toolkits/mplot3d/axes3d.py
|
| |
+ +++ b/lib/mpl_toolkits/mplot3d/axes3d.py
|
| |
+ @@ -626,7 +626,8 @@ class Axes3D(Axes):
|
| |
+ reverse = left > right
|
| |
+ left, right = self.xaxis.get_major_locator().nonsingular(left, right)
|
| |
+ left, right = self.xaxis.limit_range_for_scale(left, right)
|
| |
+ - left, right = sorted([left, right], reverse=reverse)
|
| |
+ + # cast to bool to avoid bad interaction between python 3.8 and np.bool_
|
| |
+ + left, right = sorted([left, right], reverse=bool(reverse))
|
| |
+ self.xy_viewLim.intervalx = (left, right)
|
| |
+
|
| |
+ if auto is not None:
|
| |