@@ -2128,50 +2128,74 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2128
2128
xrot = None , ylabelsize = None , yrot = None , ax = None , sharex = False ,
2129
2129
sharey = False , figsize = None , layout = None , bins = 10 , ** kwds ):
2130
2130
"""
2131
- Draw histogram of the DataFrame's series using matplotlib / pylab.
2131
+ Draw histogram of the DataFrame's Series using matplotlib.
2132
+
2133
+ A histogram is a representation of the distribution of data.
2134
+ This function wraps the matplotlib histogram function for each series in
2135
+ the DataFrame. It returns an array with a plot for each histogram.
2132
2136
2133
2137
Parameters
2134
2138
----------
2135
2139
data : DataFrame
2140
+ The pandas object holding the data.
2136
2141
column : string or sequence
2137
- If passed, will be used to limit data to a subset of columns
2142
+ If passed, will be used to limit data to a subset of columns.
2138
2143
by : object, optional
2139
- If passed, then used to form histograms for separate groups
2144
+ If passed, then used to form histograms for separate groups.
2140
2145
grid : boolean, default True
2141
- Whether to show axis grid lines
2146
+ Whether to show axis grid lines.
2142
2147
xlabelsize : int, default None
2143
- If specified changes the x-axis label size
2148
+ If specified changes the x-axis label size.
2144
2149
xrot : float, default None
2145
- rotation of x axis labels
2150
+ Rotation of x axis labels.
2146
2151
ylabelsize : int, default None
2147
- If specified changes the y-axis label size
2152
+ If specified changes the y-axis label size.
2148
2153
yrot : float, default None
2149
- rotation of y axis labels
2150
- ax : matplotlib axes object, default None
2154
+ Rotation of y axis labels.
2155
+ ax : Matplotlib axes object, default None
2156
+ The axes to plot the histogram on.
2151
2157
sharex : boolean, default True if ax is None else False
2152
2158
In case subplots=True, share x axis and set some x axis labels to
2153
2159
invisible; defaults to True if ax is None otherwise False if an ax
2154
- is passed in; Be aware, that passing in both an ax and sharex=True
2155
- will alter all x axis labels for all subplots in a figure!
2160
+ is passed in.
2161
+ Be aware: passing in both an ax and sharex=True will alter all x axis
2162
+ labels for all subplots in a figure.
2156
2163
sharey : boolean, default False
2157
2164
In case subplots=True, share y axis and set some y axis labels to
2158
- invisible
2165
+ invisible.
2159
2166
figsize : tuple
2160
- The size of the figure to create in inches by default
2167
+ The size in inches of the figure to create. Uses the value in
2168
+ `matplotlib.rcParams` by default.
2161
2169
layout : tuple, optional
2162
- Tuple of (rows, columns) for the layout of the histograms
2170
+ Tuple of (rows, columns) for the layout of the histograms.
2163
2171
bins : integer or sequence, default 10
2164
2172
Number of histogram bins to be used. If an integer is given, bins + 1
2165
2173
bin edges are calculated and returned. If bins is a sequence, gives
2166
2174
bin edges, including left edge of first bin and right edge of last
2167
2175
bin. In this case, bins is returned unmodified.
2168
- `**kwds` : other plotting keyword arguments
2169
- To be passed to hist function
2176
+ kwds : Keyword Arguments
2177
+ All other plotting keyword arguments to be passed to
2178
+ matplotlib's boxplot function.
2179
+
2180
+ Returns
2181
+ -------
2182
+ axes : matplotlib.AxesSubplot or numpy.ndarray of them
2170
2183
2171
2184
See Also
2172
2185
--------
2173
2186
matplotlib.axes.Axes.hist : Plot a histogram using matplotlib.
2174
2187
2188
+ Examples
2189
+ --------
2190
+
2191
+ .. plot::
2192
+ :context: close-figs
2193
+
2194
+ >>> df = pd.DataFrame({
2195
+ ... 'length': [ 1.5, 0.5, 1.2, 0.9, 3],
2196
+ ... 'width': [ 0.7, 0.2, 0.15, 0.2, 1.1]
2197
+ ... }, index= ['pig', 'rabbit', 'duck', 'chicken', 'horse'])
2198
+ >>> hist = df.hist(bins=3)
2175
2199
"""
2176
2200
_converter ._WARN = False
2177
2201
if by is not None :
0 commit comments