Skip to content

Commit 3db87c6

Browse files
committed
Do not fail when when markers are numpy integers
1 parent fdf8995 commit 3db87c6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _set_marker(self, marker):
308308
"""
309309
if isinstance(marker, str) and cbook.is_math_text(marker):
310310
self._marker_function = self._set_mathtext_path
311-
elif isinstance(marker, (int, str)) and marker in self.markers:
311+
elif isinstance(marker, (int, str, np.integer)) and marker in self.markers:
312312
self._marker_function = getattr(self, '_set_' + self.markers[marker])
313313
elif (isinstance(marker, np.ndarray) and marker.ndim == 2 and
314314
marker.shape[1] == 2):

lib/matplotlib/tests/test_marker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_marker_fillstyle():
2222
r'$\frac{1}{2}$',
2323
"$\u266B$",
2424
1,
25+
np.int64(1),
2526
markers.TICKLEFT,
2627
[[-1, 0], [1, 0]],
2728
np.array([[-1, 0], [1, 0]]),

0 commit comments

Comments
 (0)