Skip to content

Commit 89b21b5

Browse files
authored
Merge pull request matplotlib#22907 from raphaelquast/fix_QuadMesh_cursor_data
Fix quad mesh cursor data
2 parents fabcc6b + 2b10e52 commit 89b21b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/collections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,6 +2201,7 @@ def get_cursor_data(self, event):
22012201
contained, info = self.contains(event)
22022202
if len(info["ind"]) == 1:
22032203
ind, = info["ind"]
2204-
return self.get_array()[ind]
2204+
array = self.get_array()
2205+
return array[ind] if array else None
22052206
else:
22062207
return None

0 commit comments

Comments
 (0)