@@ -343,3 +343,28 @@ def test_input_copy(fig_test, fig_ref):
343343 # Trigger cache invalidation
344344 l .set_drawstyle ("steps" )
345345 fig_ref .add_subplot ().plot ([0 , 2 , 4 ], [0 , 2 , 4 ], ".-" , drawstyle = "steps" )
346+
347+
348+ @check_figures_equal (extensions = ["png" ])
349+ def test_markevery_prop_cycle (fig_test , fig_ref ):
350+ """Test that we can set markevery prop_cycle."""
351+ cases = [None , 8 , (30 , 8 ), [16 , 24 , 30 ], [0 , - 1 ],
352+ slice (100 , 200 , 3 ), 0.1 , 0.3 , 1.5 ,
353+ (0.0 , 0.1 ), (0.45 , 0.1 )]
354+
355+ cmap = plt .get_cmap ('jet' )
356+ colors = cmap (np .linspace (0.2 , 0.8 , len (cases )))
357+
358+ x = np .linspace (- 1 , 1 )
359+ y = 5 * x ** 2
360+
361+ axs = fig_ref .add_subplot ()
362+ for i , markevery in enumerate (cases ):
363+ axs .plot (y - i , 'o-' , markevery = markevery , color = colors [i ])
364+
365+ matplotlib .rcParams ['axes.prop_cycle' ] = cycler (markevery = cases ,
366+ color = colors )
367+
368+ ax = fig_test .add_subplot ()
369+ for i , _ in enumerate (cases ):
370+ ax .plot (y - i , 'o-' )
0 commit comments