Skip to content

Commit b8f56f2

Browse files
author
Tom Augspurger
committed
Merge pull request pandas-dev#6935 from TomAugspurger/hist-fix
BUG: pass bins arg in hist_frame
2 parents a4a819f + 020197f commit b8f56f2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pandas/tests/test_graphics.py

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ def test_hist(self):
126126
with tm.assertRaises(ValueError):
127127
self.ts.hist(by=self.ts.index, figure=fig)
128128

129+
@slow
130+
def test_hist_bins(self):
131+
df = DataFrame(np.random.randn(10, 2))
132+
ax = df.hist(bins=2)[0][0]
133+
self.assertEqual(len(ax.patches), 2)
134+
129135
@slow
130136
def test_hist_layout(self):
131137
n = 10

pandas/tools/plotting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
23422342
ax = axes[i / cols, i % cols]
23432343
ax.xaxis.set_visible(True)
23442344
ax.yaxis.set_visible(True)
2345-
ax.hist(data[col].dropna().values, **kwds)
2345+
ax.hist(data[col].dropna().values, bins=bins, **kwds)
23462346
ax.set_title(col)
23472347
ax.grid(grid)
23482348

0 commit comments

Comments
 (0)