diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 33f5dfbf37cf..90e26c30b1c8 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1524,6 +1524,26 @@ def test_bar_timedelta(): (10, 20)) +def test_bar_pandas(pd): + # Smoke test for pandas + + fig, ax = plt.subplots() + + df = pd.DataFrame( + {'year': [2018, 2018, 2018], + 'month': [1, 1, 1], + 'day': [1, 2, 3], + 'value': [1, 2, 3]}) + df['date'] = pd.to_datetime(df[['year', 'month', 'day']]) + + monthly = df[['date', 'value']].groupby(['date']).sum() + dates = monthly.index + forecast = monthly['value'] + baseline = monthly['value'] + ax.bar(dates, forecast, width=10, align='center') + ax.plot(dates, baseline, color='orange', lw=4) + + @image_comparison(baseline_images=['hist_log'], remove_text=True) def test_hist_log():
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: