8000 Merge pull request #22957 from raphaelquast/fix_QuadMesh_cursor_data · matplotlib/matplotlib@2aa71eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 2aa71eb

Browse files
authored
Merge pull request #22957 from raphaelquast/fix_QuadMesh_cursor_data
fix "is" comparison for np.array
2 parents 183c0e7 + 8b97f26 commit 2aa71eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/collections.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,9 @@ def get_cursor_data(self, event):
22002200
if len(info["ind"]) == 1:
22012201
ind, = info["ind"]
22022202
array = self.get_array()
2203-
return array[ind] if array else None
2203+
if array is not None:
2204+
return array[ind]
2205+
else:
2206+
return None
22042207
else:
22052208
return None

0 commit comments

Comments
 (0)
0