8000 Backport PR #22957: fix "is" comparison for np.array · matplotlib/matplotlib@f9fe06b · GitHub
[go: up one dir, main page]

Skip to content

Commit f9fe06b

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PR #22957: fix "is" comparison for np.array
1 parent 6061fe6 commit f9fe06b

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
@@ -2214,6 +2214,9 @@ def get_cursor_data(self, event):
22142214
if len(info["ind"]) == 1:
22152215
ind, = info["ind"]
22162216
array = self.get_array()
2217-
return array[ind] if array else None
2217+
if array is not None:
2218+
return array[ind]
2219+
else:
2220+
return None
22182221
else:
22192222
return None

0 commit comments

Comments
 (0)
0