Blob Blame Raw
From a95786dc8f982c8f7d212badad883754fe448c98 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 7 Oct 2017 00:28:59 -0400
Subject: [PATCH 4/8] Fix AxesImage.get_cursor_data on arm.

For some reason, NaN gets converted to 0 as an integer instead of
INT_MIN like on x86.

Fixes #6538.

Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
 lib/matplotlib/image.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py
index ea2331cb4..52decc3ec 100644
--- a/lib/matplotlib/image.py
+++ b/lib/matplotlib/image.py
@@ -822,7 +822,10 @@ class AxesImage(_ImageBase):
         array_extent = Bbox([[0, 0], arr.shape[:2]])
         trans = BboxTransform(boxin=data_extent, boxout=array_extent)
         y, x = event.ydata, event.xdata
-        i, j = trans.transform_point([y, x]).astype(int)
+        point = trans.transform_point([y, x])
+        if any(np.isnan(point)):
+            return None
+        i, j = point.astype(int)
         # Clip the coordinates at array bounds
         if not (0 <= i < arr.shape[0]) or not (0 <= j < arr.shape[1]):
             return None
-- 
2.13.5