Skip to content

TST: Add test for x-axis labels in subplot with secondary_y=True #60294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pandas/tests/plotting/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,3 +958,16 @@ 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()

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