File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1524,6 +1524,26 @@ def test_bar_timedelta():
1524
1524
(10 , 20 ))
1525
1525
1526
1526
1527
+ def test_bar_pandas (pd ):
1528
+ # Smoke test for pandas
1529
+
1530
+ fig , ax = plt .subplots ()
1531
+
1532
+ df = pd .DataFrame (
1533
+ {'year' : [2018 , 2018 , 2018 ],
1534
+ 'month' : [1 , 1 , 1 ],
1535
+ 'day' : [1 , 2 , 3 ],
1536
+ 'value' : [1 , 2 , 3 ]})
1537
+ df ['date' ] = pd .to_datetime (df [['year' , 'month' , 'day' ]])
1538
+
1539
+ monthly = df [['date' , 'value' ]].groupby (['date' ]).sum ()
1540
+ dates = monthly .index
1541
+ forecast = monthly ['value' ]
1542
+ baseline = monthly ['value' ]
1543
+ ax .bar (dates , forecast , width = 10 , align = 'center' )
1544
+ ax .plot (dates , baseline , color = 'orange' , lw = 4 )
1545
+
1546
+
1527
1547
@image_comparison (baseline_images = ['hist_log' ],
1528
1548
remove_text = True )
1529
1549
def test_hist_log ():
You can’t perform that action at this time.
0 commit comments