|
19 | 19 |
|
20 | 20 | from pandas.io.formats.printing import pprint_thing
|
21 | 21 |
|
22 |
| -pytestmark = pytest.mark.slow |
23 |
| - |
24 | 22 |
|
25 | 23 | @td.skip_if_no_mpl
|
26 | 24 | class TestDataFramePlotsSubplots(TestPlotBase):
|
| 25 | + @pytest.mark.slow |
27 | 26 | def test_subplots(self):
|
28 | 27 | df = DataFrame(np.random.rand(10, 3), index=list(string.ascii_letters[:10]))
|
29 | 28 |
|
@@ -237,6 +236,7 @@ def test_subplots_layout_single_column(
|
237 | 236 | )
|
238 | 237 | assert axes.shape == expected_shape
|
239 | 238 |
|
| 239 | + @pytest.mark.slow |
240 | 240 | def test_subplots_warnings(self):
|
241 | 241 | # GH 9464
|
242 | 242 | with tm.assert_produces_warning(None):
|
@@ -580,19 +580,21 @@ def test_bar_barwidth_position(self, kwargs):
|
580 | 580 | df = DataFrame(np.random.randn(5, 5))
|
581 | 581 | self._check_bar_alignment(df, width=0.9, position=0.2, **kwargs)
|
582 | 582 |
|
583 |
| - def test_bar_barwidth_position_int(self): |
| 583 | + @pytest.mark.parametrize("w", [1, 1.0]) |
| 584 | + def test_bar_barwidth_position_int(self, w): |
| 585 | + # GH 12979 |
| 586 | + df = DataFrame(np.random.randn(5, 5)) |
| 587 | + ax = df.plot.bar(stacked=True, width=w) |
| 588 | + ticks = ax.xaxis.get_ticklocs() |
| 589 | + tm.assert_numpy_array_equal(ticks, np.array([0, 1, 2, 3, 4])) |
| 590 | + assert ax.get_xlim() == (-0.75, 4.75) |
| 591 | + # check left-edge of bars |
| 592 | + assert ax.patches[0].get_x() == -0.5 |
| 593 | + assert ax.patches[-1].get_x() == 3.5 |
| 594 | + |
| 595 | + def test_bar_barwidth_position_int_width_1(self): |
584 | 596 | # GH 12979
|
585 | 597 | df = DataFrame(np.random.randn(5, 5))
|
586 |
| - |
587 |
| - for w in [1, 1.0]: |
588 |
| - ax = df.plot.bar(stacked=True, width=w) |
589 |
| - ticks = ax.xaxis.get_ticklocs() |
590 |
| - tm.assert_numpy_array_equal(ticks, np.array([0, 1, 2, 3, 4])) |
591 |
| - assert ax.get_xlim() == (-0.75, 4.75) |
592 |
| - # check left-edge of bars |
593 |
| - assert ax.patches[0].get_x() == -0.5 |
594 |
| - assert ax.patches[-1].get_x() == 3.5 |
595 |
| - |
596 | 598 | self._check_bar_alignment(df, kind="bar", stacked=True, width=1)
|
597 | 599 | self._check_bar_alignment(df, kind="barh", stacked=False, width=1)
|
598 | 600 | self._check_bar_alignment(df, kind="barh", stacked=True, width=1)
|
|
0 commit comments