Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06e1b07

Browse files
committed
TST pandas support bar
1 parent d5dd383 commit 06e1b07

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,21 @@ def test_bar_timedelta():
15241524
(10, 20))
15251525

15261526

1527+
def test_bar_pandas(pd):
1528+
# Smoke test for pandas
1529+
fig = plt.figure()
1530+
ax = fig.gca()
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+
ax.bar(df['date'], df['value'])
1540+
1541+
15271542
@image_comparison(baseline_images=['hist_log'],
15281543
remove_text=True)
15291544
def test_hist_log():

0 commit comments

Comments
 (0)