@@ -218,11 +218,27 @@ def test_hist2d(self):
218
218
fig , ax = plt .subplots ()
219
219
ax .hist2d (...)
220
220
221
- @pytest .mark .xfail (reason = "Test for hlines not written yet" )
222
221
@mpl .style .context ("default" )
223
222
def test_hlines (self ):
224
- fig , ax = plt .subplots ()
225
- ax .hlines (...)
223
+ mpl .rcParams ["date.converter" ] = 'concise'
224
+ fig , axs = plt .subplots (2 , 3 , layout = 'constrained' )
225
+ dateStrs = ['2023-03-08' ,
226
+ '2023-04-09' ,
227
+ '2023-05-13' ,
228
+ '2023-07-28' ,
229
+ '2023-12-24' ]
230
+ dates = [datetime .datetime (2023 , m * 2 , 10 ) for m in range (1 , 6 )]
231
+ npDates = [np .datetime64 (s ) for s in dateStrs ]
232
+ axs [0 , 0 ].hlines (y = dates ,
233
+ xmin = [0.1 , 0.2 , 0.3 , 0.4 , 0.5 ],
234
+ xmax = [0.5 , 0.6 , 0.7 , 0.8 , 0.9 ])
235
+ axs [0 , 1 ].hlines (y = dates , xmin = 0.2 , xmax = 0.8 )
236
+ axs [0 , 2 ].hlines (dates , xmin = 0 , xmax = 1 )
237
+ axs [1 , 0 ].hlines (y = npDates ,
238
+ xmin = [0.5 , 0.6 , 0.7 , 0.8 , 0.9 ],
239
+ xmax = [0.1 , 0.2 , 0.3 , 0.4 , 0.5 ])
240
+ axs [1 , 1 ].hlines (y = npDates , xmin = 0.45 , xmax = 0.65 )
241
+ axs [1 , 2 ].hlines (npDates , xmin = 0 , xmax = 1 )
226
242
227
243
@pytest .mark .xfail (reason = "Test for imshow not written yet" )
228
244
@mpl .style .context ("default" )
0 commit comments