From 178f9ab063163f5f3dd64ca855083c37c849b668 Mon Sep 17 00:00:00 2001 From: Jason Mok Date: Tue, 12 Nov 2024 22:52:36 -0600 Subject: [PATCH 1/2] TST: Add test for x-axis labels in subplots with secondary_y=True TST: Add test for x-axis labels in subplots with secondary_y=True TST: Add test for x-axis labels in subplots with secondary_y=True TST: Add test for x-axis labels in subplots with secondary_y=True TST: Add test for x-axis labels in subplots with secondary_y=True --- pandas/tests/plotting/test_series.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandas/tests/plotting/test_series.py b/pandas/tests/plotting/test_series.py index 52ca66c218862..b0dbaa0b1650a 100644 --- a/pandas/tests/plotting/test_series.py +++ b/pandas/tests/plotting/test_series.py @@ -958,3 +958,17 @@ def test_plot_no_warning(self, ts): # TODO(3.0): this can be removed once Period[B] deprecation is enforced with tm.assert_produces_warning(False): _ = ts.plot() + + @pytest.mark.slow + def test_secondary_y_subplot_axis_labels(self): + # GH#14102 + s1 = Series([5, 7, 6, 8, 7], index=[1, 2, 3, 4, 5]) + s2 = Series([6, 4, 5, 3, 4], index=[1, 2, 3, 4, 5]) + + ax = plt.subplot(2, 1, 1) + s1.plot(ax=ax) + s2.plot(ax=ax, secondary_y=True) + ax2 = plt.subplot(2, 1, 2) + s1.plot(ax=ax2) + assert len(ax.xaxis.get_minor_ticks()) == 0 + assert len(ax.get_xticklabels()) > 0 From 062656f2f2ba833963efd007ddf384b402781c77 Mon Sep 17 00:00:00 2001 From: Jason Mok Date: Wed, 13 Nov 2024 17:49:19 -0600 Subject: [PATCH 2/2] Remove pytest.mark.slow --- pandas/tests/plotting/test_series.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/tests/plotting/test_series.py b/pandas/tests/plotting/test_series.py index b0dbaa0b1650a..9675b936c171e 100644 --- a/pandas/tests/plotting/test_series.py +++ b/pandas/tests/plotting/test_series.py @@ -959,7 +959,6 @@ def test_plot_no_warning(self, ts): with tm.assert_produces_warning(False): _ = ts.plot() - @pytest.mark.slow def test_secondary_y_subplot_axis_labels(self): # GH#14102 s1 = Series([5, 7, 6, 8, 7], index=[1, 2, 3, 4, 5])