Skip to content

Commit 45aa7a5

Browse files
jasonmokkJason Mok
and
Jason Mok
authored
TST: Add test for x-axis labels in subplot with secondary_y=True (#60294)
* 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 * Remove pytest.mark.slow --------- Co-authored-by: Jason Mok <[email protected]>
1 parent 34c39e9 commit 45aa7a5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/plotting/test_series.py

+13
Original file line numberDiff line numberDiff line change
@@ -958,3 +958,16 @@ def test_plot_no_warning(self, ts):
958958
# TODO(3.0): this can be removed once Period[B] deprecation is enforced
959959
with tm.assert_produces_warning(False):
960960
_ = ts.plot()
961+
962+
def test_secondary_y_subplot_axis_labels(self):
963+
# GH#14102
964+
s1 = Series([5, 7, 6, 8, 7], index=[1, 2, 3, 4, 5])
965+
s2 = Series([6, 4, 5, 3, 4], index=[1, 2, 3, 4, 5])
966+
967+
ax = plt.subplot(2, 1, 1)
968+
s1.plot(ax=ax)
969+
s2.plot(ax=ax, secondary_y=True)
970+
ax2 = plt.subplot(2, 1, 2)
971+
s1.plot(ax=ax2)
972+
assert len(ax.xaxis.get_minor_ticks()) == 0
973+
assert len(ax.get_xticklabels()) > 0

0 commit comments

Comments
 (0)