Skip to content

TST: Address matplotlib 3.10 deprecation of vert= #60584

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 7 commits into from
Dec 17, 2024

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Visualization plotting labels Dec 16, 2024
@mroeschke mroeschke added this to the 2.3 milestone Dec 16, 2024
@mroeschke
Copy link
Member Author

Merging to get a green CI

@mroeschke mroeschke merged commit edf00e9 into pandas-dev:main Dec 17, 2024
51 checks passed
@mroeschke mroeschke deleted the tst/mpl/vert branch December 17, 2024 23:02
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Dec 17, 2024
mroeschke added a commit that referenced this pull request Dec 18, 2024
…ecation of vert=) (#60586)

* Backport PR #60584: TST: Address matplotlib 3.10 deprecation of vert=

* Add missing import

* Ignore pre-commit check

---------

Co-authored-by: Matthew Roeschke <[email protected]>
Comment on lines +1074 to +1089
@pytest.mark.xfail(
Version(mpl.__version__) >= Version("3.10"),
reason="Fails starting with matplotlib 3.10",
)
def test_boxplot_vertical(self, hist_df):
df = hist_df
numeric_cols = df._get_numeric_data().columns
labels = [pprint_thing(c) for c in numeric_cols]

# if horizontal, yticklabels are rotated
ax = df.plot.box(rot=50, fontsize=8, vert=False)
kwargs = (
{"vert": False}
if Version(mpl.__version__) < Version("3.10")
else {"orientation": "horizontal"}
)
ax = df.plot.box(rot=50, fontsize=8, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

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

Just to understand the change: even though using the new keyword for mpl >= 3.10, it is still failing somehow? (given you added the xfail)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that's correct. It appears that changing this to use the equivalent, new matplotlib 3.10 keyword causes some tests to fail. I was unable to determine if the failure was on our side or the matplotlib side

@jorisvandenbossche
Copy link
Member

Thanks for addressing this!

KevsterAmp pushed a commit to KevsterAmp/pandas that referenced this pull request Mar 12, 2025
* TST: Address matplotlib 3.10 deprecation of vert=

* Type in ._version

* Address other failures

* more test faillures

* Add more xfails

* mypy error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Visualization plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants