There was an error while loading. Please reload this page.
1 parent 6c2eda1 commit 62297d1Copy full SHA for 62297d1
2 files changed
lib/matplotlib/colors.py
@@ -98,7 +98,7 @@ def _sanitize_extrema(ex):
98
if ex is None:
99
return ex
100
try:
101
- ret = np.asscalar(ex)
+ ret = ex.item()
102
except AttributeError:
103
ret = float(ex)
104
return ret
lib/matplotlib/image.py
@@ -421,9 +421,9 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
421
422
A_scaled -= a_min
423
# a_min and a_max might be ndarray subclasses so use
424
- # asscalar to avoid errors
425
- a_min = np.asscalar(a_min.astype(scaled_dtype))
426
- a_max = np.asscalar(a_max.astype(scaled_dtype))
+ # item to avoid errors
+ a_min = a_min.astype(scaled_dtype).item()
+ a_max = a_max.astype(scaled_dtype).item()
427
428
if a_min != a_max:
429
A_scaled /= ((a_max - a_min) / 0.8)
0 commit comments