File tree 2 files changed +22
-1
lines changed
Filter options
2 files changed +22
-1
lines changed
Original file line number Diff line number Diff line change @@ -255,7 +255,8 @@ def set_marker(self, marker):
255
255
elif (isinstance (marker , Sized ) and len (marker ) in (2 , 3 ) and
256
256
marker [1 ] in (0 , 1 , 2 , 3 )):
257
257
self ._marker_function = self ._set_tuple_marker
258
- elif not isinstance (marker , list ) and marker in self .markers :
258
+ elif (not isinstance (marker , (np .ndarray , list )) and
259
+ marker in self .markers ):
259
260
self ._marker_function = getattr (
260
261
self , '_set_' + self .markers [marker ])
261
262
elif is_string_like (marker ) and is_math_text (marker ):
Original file line number Diff line number Diff line change
1
+ import numpy as np
2
+ from matplotlib import markers
3
+
4
+ import pytest
5
+
6
+
7
+ def test_markers_valid ():
8
+ marker_style = markers .MarkerStyle ()
9
+ mrk_array = np .array ([[- 0.5 , 0 ],
10
+ [0.5 , 0 ]])
11
+ # Checking this doesn't fail.
12
+ marker_style .set_marker (mrk_array )
13
+
14
+
15
+ def test_markers_invalid ():
16
+ marker_style = markers .MarkerStyle ()
17
+ mrk_array = np .array ([[- 0.5 , 0 , 1 , 2 , 3 ]])
18
+ # Checking this doesn't fail.
19
+ with pytest .raises (ValueError ):
20
+ marker_style .set_marker (mrk_array )
You can’t perform that action at this time.
0 commit comments