Skip to content

Commit ea5321b

Browse files
Jason MokJason Mok
authored andcommitted
TST: Add test for x-axis labels in subplots with
TST: Add test for x-axis labels in subplots with
1 parent 73da90c commit ea5321b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/plotting/test_series.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,3 +958,18 @@ 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+
@pytest.mark.slow
963+
def test_x_axis_labels_secondary_y(self):
964+
# GH#14102
965+
s1 = Series([5, 7, 6, 8, 7], index=[1, 2, 3, 4, 5])
966+
s2 = Series([6, 4, 5, 3, 4], index=[1, 2, 3, 4, 5])
967+
968+
ax1 = plt.subplot(2, 1, 1)
969+
s1.plot(ax=ax1)
970+
s2.plot(ax=ax1, secondary_y=True)
971+
assert len(ax1.xaxis.get_minor_ticks()) == 0
972+
973+
ax2 = plt.subplot(2, 1, 2)
974+
s1.plot(ax=ax2)
975+
assert len(ax1.xaxis.get_minor_ticks()) == 0

0 commit comments

Comments
 (0)