From a894b6414e9205a88a3d9a53142170b4ccaa01b1 Mon Sep 17 00:00:00 2001 From: Jason Mok Date: Fri, 8 Nov 2024 13:29:02 -0600 Subject: [PATCH] TST: Add test for visibility of x label and xtick labels for plot.hexbin TST: Add test for visibility of x label and xtick labels for plot.hexbin TST: Add test for visibility of x label and xtick labels for plot.hexbin TST: Add test for visibility of x label and xtick labels for plot.hexbin TST: Add test for visibility of x label and xtick labels for plot.hexbin Minimize size of test data --- pandas/tests/plotting/frame/test_frame.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 087280ed3e01d..845f369d3090f 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -2589,6 +2589,14 @@ def test_plot_period_index_makes_no_right_shift(self, freq): result = ax.get_lines()[0].get_xdata() assert all(str(result[i]) == str(expected[i]) for i in range(4)) + def test_plot_display_xlabel_and_xticks(self): + # GH#44050 + df = DataFrame(np.random.default_rng(2).random((10, 2)), columns=["a", "b"]) + ax = df.plot.hexbin(x="a", y="b") + + _check_visible([ax.xaxis.get_label()], visible=True) + _check_visible(ax.get_xticklabels(), visible=True) + def _generate_4_axes_via_gridspec(): gs = mpl.gridspec.GridSpec(2, 2)