@@ -1481,6 +1481,29 @@ def test_barh_tick_label():
1481
1481
align = 'center' )
1482
1482
1483
1483
1484
+ def test_bar_timedelta ():
1485
+ """smoketest that bar can handle width and height in delta units"""
1486
+ fig , ax = plt .subplots ()
1487
+ ax .bar (datetime .datetime (2018 , 1 , 1 ), 1. ,
1488
+ width = datetime .timedelta (hours = 3 ))
1489
+ ax .bar (datetime .datetime (2018 , 1 , 1 ), 1. ,
1490
+ xerr = datetime .timedelta (hours = 2 ),
1491
+ width = datetime .timedelta (hours = 3 ))
1492
+ fig , ax = plt .subplots ()
1493
+ ax .barh (datetime .datetime (2018 , 1 , 1 ), 1 ,
1494
+ height = datetime .timedelta (hours = 3 ))
1495
+ ax .barh (datetime .datetime (2018 , 1 , 1 ), 1 ,
1496
+ height = datetime .timedelta (hours = 3 ),
1497
+ yerr = datetime .timedelta (hours = 2 ))
1498
+ fig , ax = plt .subplots ()
1499
+ ax .barh ([datetime .datetime (2018 , 1 , 1 ), datetime .datetime (2018 , 1 , 1 )],
1500
+ np .array ([1 , 1.5 ]),
1501
+ height = datetime .timedelta (hours = 3 ))
1502
+ ax .barh ([datetime .datetime (2018 , 1 , 1 ), datetime .datetime (2018 , 1 , 1 )],
1503
+ np .array ([1 , 1.5 ]),
1504
+ height = [datetime .timedelta (hours = t ) for t in [1 , 2 ]])
1505
+
1506
+
1484
1507
@image_comparison (baseline_images = ['hist_log' ],
1485
1508
remove_text = True )
1486
1509
def test_hist_log ():
0 commit comments