From 677a4064f87edef0ef27c68b520df5094eb4ee87 Mon Sep 17 00:00:00 2001 From: Koustav Ghosh Date: Sat, 7 Oct 2023 11:23:19 +0530 Subject: [PATCH] Add test_contourf #26864 --- lib/matplotlib/tests/test_datetime.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index 53958229f174..39bf6f6356e8 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -122,11 +122,29 @@ def test_contour(self): fig, ax = plt.subplots() ax.contour(...) - @pytest.mark.xfail(reason="Test for contourf not written yet") @mpl.style.context("default") def test_contourf(self): - fig, ax = plt.subplots() - ax.contourf(...) + mpl.rcParams["date.converter"] = "concise" + range_threshold = 10 + fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout="constrained") + + x_dates = np.array( + [datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)] + ) + y_dates = np.array( + [datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)] + ) + x_ranges = np.array(range(1, range_threshold)) + y_ranges = np.array(range(1, range_threshold)) + + X_dates, Y_dates = np.meshgrid(x_dates, y_dates) + X_ranges, Y_ranges = np.meshgrid(x_ranges, y_ranges) + + Z_ranges = np.cos(X_ranges / 4) + np.sin(Y_ranges / 4) + + ax1.contourf(X_dates, Y_dates, Z_ranges) + ax2.contourf(X_dates, Y_ranges, Z_ranges) + ax3.contourf(X_ranges, Y_dates, Z_ranges) @pytest.mark.xfail(reason="Test for csd 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