diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py index a9425400bedb3..b1faf3047beea 100644 --- a/pandas/tests/test_graphics.py +++ b/pandas/tests/test_graphics.py @@ -126,6 +126,12 @@ def test_hist(self): with tm.assertRaises(ValueError): self.ts.hist(by=self.ts.index, figure=fig) + @slow + def test_hist_bins(self): + df = DataFrame(np.random.randn(10, 2)) + ax = df.hist(bins=2)[0][0] + self.assertEqual(len(ax.patches), 2) + @slow def test_hist_layout(self): n = 10 diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index 158cfeb5e3a6f..4d348c37ed927 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -2342,7 +2342,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, ax = axes[i / cols, i % cols] ax.xaxis.set_visible(True) ax.yaxis.set_visible(True) - ax.hist(data[col].dropna().values, **kwds) + ax.hist(data[col].dropna().values, bins=bins, **kwds) ax.set_title(col) ax.grid(grid)