From d97c8a90e0aa848ea32a0c4f4b1dfe5bcec4d775 Mon Sep 17 00:00:00 2001 From: CozyFrog Date: Thu, 26 Oct 2023 13:24:58 -0400 Subject: [PATCH] Add test_axvline to test_datetime.py --- lib/matplotlib/tests/test_datetime.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index c9455d450b70..954151c18edb 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -44,11 +44,19 @@ def test_axline(self): fig, ax = plt.subplots() ax.axline(...) - @pytest.mark.xfail(reason="Test for axvline not written yet") @mpl.style.context("default") def test_axvline(self): - fig, ax = plt.subplots() - ax.axvline(...) + mpl.rcParams["date.converter"] = 'concise' + fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained') + ax1.set_xlim(left=datetime.datetime(2020, 4, 1), + right=datetime.datetime(2020, 8, 1)) + ax2.set_xlim(left=np.datetime64('2005-01-01'), + right=np.datetime64('2005-04-01')) + ax3.set_xlim(left=datetime.datetime(2023, 9, 1), + right=datetime.datetime(2023, 11, 1)) + ax1.axvline(x=datetime.datetime(2020, 6, 3), ymin=0.5, ymax=0.7) + ax2.axvline(np.datetime64('2005-02-25T03:30'), ymin=0.1, ymax=0.9) + ax3.axvline(x=datetime.datetime(2023, 10, 24), ymin=0.4, ymax=0.7) @pytest.mark.xfail(reason="Test for axvspan 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