@@ -199,6 +199,61 @@ def test_step_markers(fig_test, fig_ref):
199
199
fig_ref .subplots ().plot ([0 , 0 , 1 ], [0 , 1 , 1 ], "-o" , markevery = [0 , 2 ])
200
200
201
201
202
+ #@check_figures_equal(extensions=('png',))
203
+ #def test_markevery(fig_test, fig_ref):
204
+ # np.random.seed(42)
205
+ # t = np.linspace(0, 3, 14)
206
+ # y = np.random.rand(len(t))
207
+ #
208
+ # casesA = [None, 4, (2, 5), [1, 5, 11],
209
+ # [0, -1], slice(5, 10, 2), 0.3, (0.3, 0.4),
210
+ # np.arange(len(t))[y > 0.5]]
211
+ # casesB = ["11111111111111", "10001000100010", "00100001000010",
212
+ # "01000100000100", "10000000000001", "00000101010000",
213
+ # "11011011011110", "01010011011101", "01110001110110"]
214
+ #
215
+ # axsA = fig_ref.subplots(3, 3)
216
+ # axsB = fig_test.subplots(3, 3)
217
+ #
218
+ # for ax, case in zip(axsA.flat, casesA):
219
+ # ax.plot(t, y, "-gD", markevery=case)
220
+ #
221
+ # for ax, case in zip(axsB.flat, casesB):
222
+ # ax.plot(t, y, "-gD", markevery=np.array(list(case)).astype(bool))
223
+ # fig_test.canvas.draw()
224
+ # fig_ref.canvas.draw()
225
+
226
+
227
+ @check_figures_equal (extensions = ('png' ,))
228
+ def test_markevery_debug (fig_test , fig_ref ):
229
+ """
230
+ This is just a debugging test - needs to be removed!!!!
231
+ """
232
+ t = np .arange (3 )
233
+ y = np .array ([1 ,3 ,2 ])
234
+
235
+ caseA = np .arange (len (t ))[y > 1.5 ]
236
+ caseB = "011"
237
+
238
+ axsA = fig_ref .subplots ()
239
+ axsB = fig_test .subplots ()
240
+
241
+ lA , = axsA .plot (t , y , "-gD" , markevery = caseA )
242
+ lA1 , = axsA .plot (t , y + .5 , "-gD" , markevery = caseA )
243
+ me = np .array (list (caseB )).astype (bool )
244
+ me2 = np .arange (len (t ))[me ]
245
+ lB , = axsB .plot (t , y , "-gD" , markevery = me )
246
+ lB1 , = axsB .plot (t , y + .5 , "-gD" , markevery = me2 )
247
+
248
+ for ax in [axsA , axsB ]:
249
+ ax .text (0.3 , 1.6 , f"{ lA .get_markevery ()} " )
250
+ ax .text (0.3 , 1.5 , f"{ lB .get_markevery ()} " )
251
+ ax .text (0.3 , 1.2 , f"{ lA1 .get_markevery ()} " )
252
+ ax .text (0.3 , 1.1 , f"{ lB1 .get_markevery ()} " )
253
+ fig_test .canvas .draw ()
254
+ fig_ref .canvas .draw ()
255
+
256
+
202
257
def test_marker_as_markerstyle ():
203
258
fig , ax = plt .subplots ()
204
259
line , = ax .plot ([2 , 4 , 3 ], marker = MarkerStyle ("D" ))
0 commit comments