-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: DataFrame.hist() does not get along with matplotlib.pyplot.tight_layout() #15515
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,6 +238,16 @@ def test_hist_layout(self): | |
with tm.assertRaises(ValueError): | ||
df.hist(layout=(-1, -1)) | ||
|
||
@slow | ||
# GH 9351 | ||
def test_tight_layout(self): | ||
if self.mpl_ge_2_0_0: | ||
df = DataFrame(randn(100, 2)) | ||
df.plot.hist() | ||
self.plt.tight_layout() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes that's fine. I realize this just raises |
||
|
||
tm.close() | ||
|
||
|
||
@tm.mplskip | ||
class TestDataFrameGroupByPlots(TestPlotBase): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,6 +286,14 @@ def _skip_if_mpl_1_5(): | |
pytest.skip("matplotlib 1.5") | ||
|
||
|
||
def _skip_if_mpl_1(): | ||
import matplotlib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually you don't need this, instead use:
as these are defined in the base class (you can look in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no take this function out |
||
v = matplotlib.__version__ | ||
if v < LooseVersion('2.0.0') or v[0] == '0' or v[0] == '1': | ||
import pytest | ||
pytest.skip("matplotlib 1.5") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. matpotlib < 2.0.0 |
||
|
||
|
||
def _skip_if_no_scipy(): | ||
try: | ||
import scipy.stats # noqa | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need the try/except (if it works it won't raise)
add a 1-line comment & the issue number as a comment