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

Skip to content

Commit 7b9a68d

Browse files
authored
Merge pull request #14860 from bingyao/stopgap_fix_for_pandas_converters
Stopgap fix for pandas converters in tests.
2 parents ea4274e + 66b5d8d commit 7b9a68d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,6 @@ def test_boxplot_dates_pandas(pd):
15981598

15991599
def test_bar_pandas(pd):
16001600
# Smoke test for pandas
1601-
1602-
fig, ax = plt.subplots()
1603-
16041601
df = pd.DataFrame(
16051602
{'year': [2018, 2018, 2018],
16061603
'month': [1, 1, 1],
@@ -1612,8 +1609,12 @@ def test_bar_pandas(pd):
16121609
dates = monthly.index
16131610
forecast = monthly['value']
16141611
baseline = monthly['value']
1612+
1613+
pd.plotting.register_matplotlib_converters()
1614+
fig, ax = plt.subplots()
16151615
ax.bar(dates, forecast, width=10, align='center')
16161616
ax.plot(dates, baseline, color='orange', lw=4)
1617+
pd.plotting.deregister_matplotlib_converters()
16171618

16181619

16191620
@image_comparison(['hist_log'], remove_text=True)

0 commit comments

Comments
 (0)