@@ -343,11 +343,24 @@ def test_stem(self):
343
343
fig , ax = plt .subplots ()
344
344
ax .stem (...)
345
345
346
- @pytest .mark .xfail (reason = "Test for step not written yet" )
347
346
@mpl .style .context ("default" )
348
347
def test_step (self ):
349
- fig , ax = plt .subplots ()
350
- ax .step (...)
348
+ mpl .rcParams ["date.converter" ] = "concise"
349
+ limit = 5
350
+ fig , (ax1 , ax2 , ax3 , ax4 ) = plt .subplots (4 , 1 , layout = "constrained" )
351
+
352
+ start_date = datetime .date (2023 , 1 , 1 )
353
+ date_x = [start_date + datetime .timedelta (days = i ) for i in range (1 , limit )]
354
+ date_y = [start_date + datetime .timedelta (days = i ) for i in range (1 , limit )]
355
+ x_ranges = np .array (range (1 , limit ))
356
+ y_ranges = np .array (range (1 , limit ))
357
+
358
+ ax1 .step (x_ranges , date_y , 'g' , where = 'pre' , label = 'pre' )
359
+ ax2 .step (date_x , y_ranges , 'b' , where = 'mid' , label = 'mid' )
360
+ ax3 .step (date_x , date_y , 'r' , where = 'post' , label = 'post' )
361
+ ax4 .step ("date" , "signal" ,
362
+ data = {"date" : date_x , "signal" : y_ranges },
363
+ where = 'mid' , label = 'mid' )
351
364
352
365
@pytest .mark .xfail (reason = "Test for streamplot not written yet" )
353
366
@mpl .style .context ("default" )
0 commit comments