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 8d9357e

Browse filesBrowse files
committed
Merge pull request #6622 from data-exp-lab/strip-units-imshow
FIX: ensure masked array data is an ndarray
1 parent 1caf775 commit 8d9357e
Copy full SHA for 8d9357e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,9 @@ def __call__(self, value, clip=None):
947947
result = ma.array(np.clip(result.filled(vmax), vmin, vmax),
948948
mask=mask)
949949
# ma division is very slow; we can take a shortcut
950-
resdat = result.data
950+
# use np.asarray so data passed in as an ndarray subclass are
951+
# interpreted as an ndarray. See issue #6622.
952+
resdat = np.asarray(result.data)
951953
resdat -= vmin
952954
resdat /= (vmax - vmin)
953955
result = np.ma.array(resdat, mask=result.mask, copy=False)

0 commit comments

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