From 8b97f26893acca44ae9954f5a05089cca97365b0 Mon Sep 17 00:00:00 2001 From: Raphael Quast Date: Mon, 2 May 2022 10:29:32 +0200 Subject: [PATCH] fix "is" comparison for np.array --- lib/matplotlib/collections.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 2e1d75c6d411..2fca1d84e65a 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -2200,6 +2200,9 @@ def get_cursor_data(self, event): if len(info["ind"]) == 1: ind, = info["ind"] array = self.get_array() - return array[ind] if array else None + if array is not None: + return array[ind] + else: + return None else: return None