From 3b2c17fb8ea985e368e33a42342e4f3d8aa94df3 Mon Sep 17 00:00:00 2001 From: AsherHounsell <61854862+AsherHounsell@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:37:36 +0000 Subject: [PATCH 1/2] Added DateTime Test for triplot --- lib/matplotlib/tests/test_datetime.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index 3c8cc8b5b8bb..fd9dbbe45f55 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -746,11 +746,18 @@ def test_tripcolor(self): fig, ax = plt.subplots() ax.tripcolor(...) - @pytest.mark.xfail(reason="Test for triplot not written yet") @mpl.style.context("default") def test_triplot(self): + mpl.rcParams["date.converter"] = "concise" fig, ax = plt.subplots() - ax.triplot(...) + np.random.seed(19680801) + + limit_value = 30 + x_dates = np.array([datetime.datetime(2023, 12, n) for n in range(1, limit_value)]) + x_dates_converted = mpl.dates.date2num(x_dates) + y_data = np.random.rand(limit_value - 1) + + ax.triplot(x_dates_converted, y_data) @pytest.mark.xfail(reason="Test for violin not written yet") @mpl.style.context("default") From 1a404f1875e412caa3e7c0657a65d67795ad34d1 Mon Sep 17 00:00:00 2001 From: AsherHounsell <61854862+AsherHounsell@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:43:55 +0000 Subject: [PATCH 2/2] Fixing Linting Errors --- lib/matplotlib/tests/test_datetime.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index fd9dbbe45f55..62e03faf9384 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -753,7 +753,9 @@ def test_triplot(self): np.random.seed(19680801) limit_value = 30 - x_dates = np.array([datetime.datetime(2023, 12, n) for n in range(1, limit_value)]) + x_dates = np.array( + [datetime.datetime(2023, 12, n) for n in range(1, limit_value)] + ) x_dates_converted = mpl.dates.date2num(x_dates) y_data = np.random.rand(limit_value - 1)