@@ -2263,7 +2263,7 @@ def plot_group(group, ax):
2263
2263
2264
2264
def hist_frame (data , column = None , by = None , grid = True , xlabelsize = None ,
2265
2265
xrot = None , ylabelsize = None , yrot = None , ax = None , sharex = False ,
2266
- sharey = False , figsize = None , layout = None , ** kwds ):
2266
+ sharey = False , figsize = None , layout = None , bins = 10 , ** kwds ):
2267
2267
"""
2268
2268
Draw histogram of the DataFrame's series using matplotlib / pylab.
2269
2269
@@ -2290,6 +2290,8 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2290
2290
figsize : tuple
2291
2291
The size of the figure to create in inches by default
2292
2292
layout: (optional) a tuple (rows, columns) for the layout of the histograms
2293
+ bins: integer, default 10
2294
+ Number of histogram bins to be used
2293
2295
kwds : other plotting keyword arguments
2294
2296
To be passed to hist function
2295
2297
"""
@@ -2302,7 +2304,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2302
2304
2303
2305
if by is not None :
2304
2306
axes = grouped_hist (data , by = by , ax = ax , grid = grid , figsize = figsize ,
2305
- sharex = sharex , sharey = sharey , layout = layout ,
2307
+ sharex = sharex , sharey = sharey , layout = layout , bins = bins ,
2306
2308
** kwds )
2307
2309
2308
2310
for ax in axes .ravel ():
@@ -2363,7 +2365,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2363
2365
2364
2366
2365
2367
def hist_series (self , by = None , ax = None , grid = True , xlabelsize = None ,
2366
- xrot = None , ylabelsize = None , yrot = None , figsize = None , ** kwds ):
2368
+ xrot = None , ylabelsize = None , yrot = None , figsize = None , bins = 10 , ** kwds ):
2367
2369
"""
2368
2370
Draw histogram of the input series using matplotlib
2369
2371
@@ -2385,6 +2387,8 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
2385
2387
rotation of y axis labels
2386
2388
figsize : tuple, default None
2387
2389
figure size in inches by default
2390
+ bins: integer, default 10
2391
+ Number of histogram bins to be used
2388
2392
kwds : keywords
2389
2393
To be passed to the actual plotting function
2390
2394
@@ -2411,7 +2415,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
2411
2415
raise AssertionError ('passed axis not bound to passed figure' )
2412
2416
values = self .dropna ().values
2413
2417
2414
- ax .hist (values , ** kwds )
2418
+ ax .hist (values , bins = bins , ** kwds )
2415
2419
ax .grid (grid )
2416
2420
axes = np .array ([ax ])
2417
2421
else :
@@ -2420,7 +2424,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
2420
2424
"'by' argument, since a new 'Figure' instance "
2421
2425
"will be created" )
2422
2426
axes = grouped_hist (self , by = by , ax = ax , grid = grid , figsize = figsize ,
2423
- ** kwds )
2427
+ bins = bins , ** kwds )
2424
2428
2425
2429
for ax in axes .ravel ():
2426
2430
if xlabelsize is not None :
0 commit comments