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 f8ea2c5

Browse filesBrowse files
authored
Merge pull request #6622 from data-exp-lab/strip-units-imshow
FIX: ensure masked array data is an ndarray
2 parents e11f2b9 + 6c9f8a9 commit f8ea2c5
Copy full SHA for f8ea2c5

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
@@ -925,7 +925,9 @@ def __call__(self, value, clip=None):
925925
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
926926
mask=mask)
927927
# ma division is very slow; we can take a shortcut
928-
resdat = result.data
928+
# use np.asarray so data passed in as an ndarray subclass are
929+
# interpreted as an ndarray. See issue #6622.
930+
resdat = np.asarray(result.data)
929931
resdat -= vmin
930932
resdat /= (vmax - vmin)
931933
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.