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 6c9f8a9

Browse filesBrowse files
author
Nathan Goldbaum
committed
colors: add comment explaining use of np.asarray
1 parent 1fcf591 commit 6c9f8a9
Copy full SHA for 6c9f8a9

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,8 @@ 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+
# use np.asarray so data passed in as an ndarray subclass are
929+
# interpreted as an ndarray. See issue #6622.
928930
resdat = np.asarray(result.data)
929931
resdat -= vmin
930932
resdat /= (vmax - vmin)

0 commit comments

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