From dceb32d2645ee6f239c370b699a657251f085c56 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Mon, 21 Jan 2019 17:44:12 +1100 Subject: [PATCH] TST pandas support bar --- lib/matplotlib/tests/test_axes.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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(): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy