Skip to content

Conversation

@jasonmokk
Copy link
Contributor

@jasonmokk jasonmokk commented Nov 8, 2024

This PR adds a unit test to pandas/tests/plotting/frame/test_frame.py to verify that hexbin plots correctly display x labels and xtick labels. Adds a test for the solved issue described in GH #44050.

@jasonmokk jasonmokk force-pushed the test-hexbin-plot-xlabels branch 4 times, most recently from 747d5da to 691f59e Compare November 8, 2024 19:51
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rhshadrach rhshadrach added Visualization plotting Needs Tests Unit test(s) needed to prevent regressions labels Nov 8, 2024
@rhshadrach rhshadrach added this to the 3.0 milestone Nov 8, 2024

def test_plot_display_xlabel_and_xticks(self):
# GH#44050
df = DataFrame(np.random.default_rng(2).random((1000, 2)), columns=["a", "b"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
df = DataFrame(np.random.default_rng(2).random((1000, 2)), columns=["a", "b"])
df = DataFrame(np.random.default_rng(2).random((10, 2)), columns=["a", "b"])

If the test is not dependent on the size of the data, best to keep it minimal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah makes sense, I've updated it.

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
@jasonmokk jasonmokk force-pushed the test-hexbin-plot-xlabels branch from 691f59e to a894b64 Compare November 12, 2024 18:39
@mroeschke mroeschke merged commit 2d116df into pandas-dev:main Nov 12, 2024
51 checks passed
@mroeschke
Copy link
Member

Thanks @jasonmokk

@jasonmokk jasonmokk deleted the test-hexbin-plot-xlabels branch November 12, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Tests Unit test(s) needed to prevent regressions Visualization plotting

3 participants