Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 291c977

Browse filesBrowse files
committed
Remove extra index error checks
1 parent ed712e3 commit 291c977
Copy full SHA for 291c977

File tree

Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,10 +1197,7 @@ def get_cursor_data(self, event):
11971197
return None
11981198
j = np.searchsorted(self._Ax, x) - 1
11991199
i = np.searchsorted(self._Ay, y) - 1
1200-
try:
1201-
return self._A[i, j]
1202-
except IndexError:
1203-
return None
1200+
return self._A[i, j]
12041201

12051202

12061203
class PcolorImage(AxesImage):
@@ -1334,10 +1331,7 @@ def get_cursor_data(self, event):
13341331
return None
13351332
j = np.searchsorted(self._Ax, x) - 1
13361333
i = np.searchsorted(self._Ay, y) - 1
1337-
try:
1338-
return self._A[i, j]
1339-
except IndexError:
1340-
return None
1334+
return self._A[i, j]
13411335

13421336

13431337
class FigureImage(_ImageBase):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.