diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index 51df709d4b14..47c54c1389be 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -209,11 +209,40 @@ def test_contourf(self): ax2.contourf(X_dates, Y_ranges, Z_ranges) ax3.contourf(X_ranges, Y_dates, Z_ranges) - @pytest.mark.xfail(reason="Test for errorbar not written yet") @mpl.style.context("default") def test_errorbar(self): - fig, ax = plt.subplots() - ax.errorbar(...) + mpl.rcParams["date.converter"] = "concise" + fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout="constrained") + limit = 7 + start_date = datetime.datetime(2023, 1, 1) + + x_dates = np.array([datetime.datetime(2023, 10, d) for d in range(1, limit)]) + y_dates = np.array([datetime.datetime(2023, 10, d) for d in range(1, limit)]) + x_date_error = datetime.timedelta(days=1) + y_date_error = datetime.timedelta(days=1) + + x_values = list(range(1, limit)) + y_values = list(range(1, limit)) + x_value_error = 0.5 + y_value_error = 0.5 + + ax1.errorbar(x_dates, y_values, + yerr=y_value_error, + capsize=10, + barsabove=True, + label='Data') + ax2.errorbar(x_values, y_dates, + xerr=x_value_error, yerr=y_date_error, + errorevery=(1, 2), + fmt='-o', label='Data') + ax3.errorbar(x_dates, y_dates, + xerr=x_date_error, yerr=y_date_error, + lolims=True, xlolims=True, + label='Data') + ax4.errorbar(x_dates, y_values, + xerr=x_date_error, yerr=y_value_error, + uplims=True, xuplims=True, + label='Data') @pytest.mark.xfail(reason="Test for eventplot not written yet") @mpl.style.context("default") 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