Skip to content

Failing tests due to change in matplotlib behaviour in 3.1.0 #26582

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

Closed
simonjayhawkins opened this issue May 30, 2019 · 2 comments
Closed

Failing tests due to change in matplotlib behaviour in 3.1.0 #26582

simonjayhawkins opened this issue May 30, 2019 · 2 comments
Labels
CI Continuous Integration Duplicate Report Duplicate issue or pull request Testing pandas testing functions or related to the test suite Visualization plotting

Comments

@simonjayhawkins
Copy link
Member

The allowed failures on Travis is currently failing on TestDataFramePlots.test_subplots

the matplotlib version used has changed today from 3.0.3 to 3.1.0

Code Sample, a copy-pastable example if possible

import matplotlib
print(matplotlib.__version__)
import numpy as np
import string
from pandas import DataFrame
df = DataFrame(np.random.rand(10, 3),
               index=list(string.ascii_letters[:10]))

axes = df.plot(kind='bar', subplots=True, sharex=True, legend=True)
for ax in axes[:-2]:
    collections = ax.get_xticklabels(minor=True)
    print(collections)
    for patch in collections:
        print(patch.get_visible())

Problem description

3.1.0
<a list of 2 Text xticklabel objects>
True
True

Expected Output

3.0.3
<a list of 7 Text xticklabel objects>
False
False
False
False
False
False
False

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

@simonjayhawkins simonjayhawkins added CI Continuous Integration Testing pandas testing functions or related to the test suite Visualization plotting labels May 30, 2019
@simonjayhawkins
Copy link
Member Author

simonjayhawkins commented May 31, 2019

AFAICT

the test calls

    def _check_visible(self, collections, visible=True):
        """
        Check each artist is visible or not

from

            for ax in axes[:-2]:
                self._check_visible(ax.xaxis)  # xaxis must be visible for grid
                self._check_visible(ax.get_xticklabels(), visible=False)
                self._check_visible(
                    ax.get_xticklabels(minor=True), visible=False)

ax.axis has a get_visible() method inherited from artist

get_xticklabels returns a list of text objects that have no documented get_visible() method.

@simonjayhawkins
Copy link
Member Author

duplicate #26714

@simonjayhawkins simonjayhawkins added the Duplicate Report Duplicate issue or pull request label Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Duplicate Report Duplicate issue or pull request Testing pandas testing functions or related to the test suite Visualization plotting
Projects
None yet
Development

No branches or pull requests

1 participant