@@ -260,11 +260,36 @@ def test_errorbar(self):
260
260
uplims = True , xuplims = True ,
261
261
label = 'Data' )
262
262
263
- @pytest .mark .xfail (reason = "Test for eventplot not written yet" )
264
263
@mpl .style .context ("default" )
265
264
def test_eventplot (self ):
266
- fig , ax = plt .subplots ()
267
- ax .eventplot (...)
265
+ mpl .rcParams ["date.converter" ] = "concise"
266
+
267
+ fig , (ax1 , ax2 ) = plt .subplots (2 , 1 , layout = "constrained" )
268
+
269
+ x_dates1 = np .array ([
270
+ datetime .datetime (2020 , 6 , 30 ),
271
+ datetime .datetime (2020 , 7 , 22 ),
272
+ datetime .datetime (2020 , 8 , 3 ),
273
+ datetime .datetime (2020 , 9 , 14 ),
274
+ ], dtype = np .datetime64 )
275
+
276
+ ax1 .eventplot (x_dates1 )
277
+
278
+ x_dates2 = np .array ([
279
+ [datetime .datetime (2020 , 6 , 30 ), datetime .datetime (2020 , 7 , 22 ),
280
+ datetime .datetime (2020 , 8 , 3 ), datetime .datetime (2020 , 9 , 14 )],
281
+ [datetime .datetime (2020 , 7 , 18 ), datetime .datetime (2020 , 7 , 21 ),
282
+ datetime .datetime (2020 , 8 , 3 ), datetime .datetime (2020 , 10 , 14 )]
283
+ ], dtype = np .datetime64 )
284
+
285
+ colors = ['C{}' .format (i ) for i in range (2 )]
286
+ lineoffsets = np .array ([1 , 6 ])
287
+ linelengths = [5 , 2 ]
288
+
289
+ ax2 .eventplot (x_dates2 ,
290
+ colors = colors ,
291
+ lineoffsets = lineoffsets ,
292
+ linelengths = linelengths )
268
293
269
294
@pytest .mark .xfail (reason = "Test for fill not written yet" )
270
295
@mpl .style .context ("default" )
0 commit comments