@@ -207,6 +207,30 @@ def test_step_markers(fig_test, fig_ref):
207207 fig_ref .subplots ().plot ([0 , 0 , 1 ], [0 , 1 , 1 ], "-o" , markevery = [0 , 2 ])
208208
209209
210+ @check_figures_equal (extensions = ('png' ,))
211+ def test_markevery (fig_test , fig_ref ):
212+ np .random .seed (42 )
213+ t = np .linspace (0 , 3 , 14 )
214+ y = np .random .rand (len (t ))
215+
216+ casesA = [None , 4 , (2 , 5 ), [1 , 5 , 11 ],
217+ [0 , - 1 ], slice (5 , 10 , 2 ), 0.3 , (0.3 , 0.4 ),
218+ np .arange (len (t ))[y > 0.5 ]]
219+ casesB = ["11111111111111" , "10001000100010" , "00100001000010" ,
220+ "01000100000100" , "10000000000001" , "00000101010000" ,
221+ "11011011011110" , "01010011011101" , "01110001110110" ]
222+
223+ axsA = fig_ref .subplots (3 , 3 )
224+ axsB = fig_test .subplots (3 , 3 )
225+
226+ for ax , case in zip (axsA .flat , casesA ):
227+ ax .plot (t , y , "-gD" , markevery = case )
228+
229+ for ax , case in zip (axsB .flat , casesB ):
230+ me = np .array (list (case )).astype (int ).astype (bool )
231+ ax .plot (t , y , "-gD" , markevery = me )
232+
233+
210234def test_marker_as_markerstyle ():
211235 fig , ax = plt .subplots ()
212236 line , = ax .plot ([2 , 4 , 3 ], marker = MarkerStyle ("D" ))
0 commit comments