Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1962d84

Browse filesBrowse files
committed
MNT: support old versions of numpy
Numpy 1.7 does not support `np.nanmin` and `np.nanmax` on masked arrays (instead of returning a number it returns a MaskedIterator).
1 parent 380453b commit 1962d84
Copy full SHA for 1962d84

File tree

1 file changed

+4
-2
lines changed
Filter options

1 file changed

+4
-2
lines changed

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
372372
scaled_dtype = A.dtype
373373
else:
374374
scaled_dtype = np.float32
375-
a_min = np.nanmin(A)
376-
a_max = np.nanmax(A)
375+
# old versions of numpy do not work with `np.nammin`
376+
# and `np.nanmax` as inputs
377+
a_min = np.ma.min(A)
378+
a_max = np.ma.max(A)
377379
# scale the input data to [.1, .9]. The Agg
378380
# interpolators clip to [0, 1] internally, use a
379381
# smaller input scale to identify which of the

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.