@@ -2263,7 +2263,7 @@ def plot_group(group, ax):
22632263
22642264def hist_frame (data , column = None , by = None , grid = True , xlabelsize = None ,
22652265 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 ):
22672267 """
22682268 Draw histogram of the DataFrame's series using matplotlib / pylab.
22692269
@@ -2290,6 +2290,8 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
22902290 figsize : tuple
22912291 The size of the figure to create in inches by default
22922292 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
22932295 kwds : other plotting keyword arguments
22942296 To be passed to hist function
22952297 """
@@ -2302,7 +2304,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
23022304
23032305 if by is not None :
23042306 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 ,
23062308 ** kwds )
23072309
23082310 for ax in axes .ravel ():
@@ -2363,7 +2365,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
23632365
23642366
23652367def 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 ):
23672369 """
23682370 Draw histogram of the input series using matplotlib
23692371
@@ -2385,6 +2387,8 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
23852387 rotation of y axis labels
23862388 figsize : tuple, default None
23872389 figure size in inches by default
2390+ bins: integer, default 10
2391+ Number of histogram bins to be used
23882392 kwds : keywords
23892393 To be passed to the actual plotting function
23902394
@@ -2411,7 +2415,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
24112415 raise AssertionError ('passed axis not bound to passed figure' )
24122416 values = self .dropna ().values
24132417
2414- ax .hist (values , ** kwds )
2418+ ax .hist (values , bins = bins , ** kwds )
24152419 ax .grid (grid )
24162420 axes = np .array ([ax ])
24172421 else :
@@ -2420,7 +2424,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None,
24202424 "'by' argument, since a new 'Figure' instance "
24212425 "will be created" )
24222426 axes = grouped_hist (self , by = by , ax = ax , grid = grid , figsize = figsize ,
2423- ** kwds )
2427+ bins = bins , ** kwds )
24242428
24252429 for ax in axes .ravel ():
24262430 if xlabelsize is not None :
0 commit comments