@@ -2173,50 +2173,81 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None,
2173
2173
xrot = None , ylabelsize = None , yrot = None , ax = None , sharex = False ,
2174
2174
sharey = False , figsize = None , layout = None , bins = 10 , ** kwds ):
2175
2175
"""
2176
- Draw histogram of the DataFrame's series using matplotlib / pylab.
2176
+ Make a histogram of the DataFrame's.
2177
+
2178
+ A `histogram`_ is a representation of the distribution of data.
2179
+ This function calls :meth:`matplotlib.pyplot.hist`, on each series in
2180
+ the DataFrame, resulting in one histogram per column.
2181
+
2182
+ .. _histogram: https://en.wikipedia.org/wiki/Histogram
2177
2183
2178
2184
Parameters
2179
2185
----------
2180
2186
data : DataFrame
2187
+ The pandas object holding the data.
2181
2188
column : string or sequence
2182
- If passed, will be used to limit data to a subset of columns
2189
+ If passed, will be used to limit data to a subset of columns.
2183
2190
by : object, optional
2184
- If passed, then used to form histograms for separate groups
2191
+ If passed, then used to form histograms for separate groups.
2185
2192
grid : boolean, default True
2186
- Whether to show axis grid lines
2193
+ Whether to show axis grid lines.
2187
2194
xlabelsize : int, default None
2188
- If specified changes the x-axis label size
2195
+ If specified changes the x-axis label size.
2189
2196
xrot : float, default None
2190
- rotation of x axis labels
2197
+ Rotation of x axis labels. For example, a value of 90 displays the
2198
+ x labels rotated 90 degrees clockwise.
2191
2199
ylabelsize : int, default None
2192
- If specified changes the y-axis label size
2200
+ If specified changes the y-axis label size.
2193
2201
yrot : float, default None
2194
- rotation of y axis labels
2195
- ax : matplotlib axes object, default None
2202
+ Rotation of y axis labels. For example, a value of 90 displays the
2203
+ y labels rotated 90 degrees clockwise.
2204
+ ax : Matplotlib axes object, default None
2205
+ The axes to plot the histogram on.
2196
2206
sharex : boolean, default True if ax is None else False
2197
2207
In case subplots=True, share x axis and set some x axis labels to
2198
2208
invisible; defaults to True if ax is None otherwise False if an ax
2199
- is passed in; Be aware, that passing in both an ax and sharex=True
2200
- will alter all x axis labels for all subplots in a figure!
2209
+ is passed in.
2210
+ Note that passing in both an ax and sharex=True will alter all x axis
2211
+ labels for all subplots in a figure.
2201
2212
sharey : boolean, default False
2202
2213
In case subplots=True, share y axis and set some y axis labels to
2203
- invisible
2214
+ invisible.
2204
2215
figsize : tuple
2205
- The size of the figure to create in inches by default
2216
+ The size in inches of the figure to create. Uses the value in
2217
+ `matplotlib.rcParams` by default.
2206
2218
layout : tuple, optional
2207
- Tuple of (rows, columns) for the layout of the histograms
2219
+ Tuple of (rows, columns) for the layout of the histograms.
2208
2220
bins : integer or sequence, default 10
2209
2221
Number of histogram bins to be used. If an integer is given, bins + 1
2210
2222
bin edges are calculated and returned. If bins is a sequence, gives
2211
2223
bin edges, including left edge of first bin and right edge of last
2212
2224
bin. In this case, bins is returned unmodified.
2213
- `**kwds` : other plotting keyword arguments
2214
- To be passed to hist function
2225
+ **kwds
2226
+ All other plotting keyword arguments to be passed to
2227
+ :meth:`matplotlib.pyplot.hist`.
2228
+
2229
+ Returns
2230
+ -------
2231
+ axes : matplotlib.AxesSubplot or numpy.ndarray of them
2215
2232
2216
2233
See Also
2217
2234
--------
2218
- matplotlib.axes.Axes.hist : Plot a histogram using matplotlib.
2235
+ matplotlib.pyplot.hist : Plot a histogram using matplotlib.
2236
+
2237
+ Examples
2238
+ --------
2239
+
2240
+ .. plot::
2241
+ :context: close-figs
2242
+
2243
+ This example draws a histogram based on the length and width of
2244
+ some animals, displayed in three bins
2219
2245
2246
+ >>> df = pd.DataFrame({
2247
+ ... 'length': [1.5, 0.5, 1.2, 0.9, 3],
2248
+ ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1]
2249
+ ... }, index= ['pig', 'rabbit', 'duck', 'chicken', 'horse'])
2250
+ >>> hist = df.hist(bins=3)
2220
2251
"""
2221
2252
_converter ._WARN = False
2222
2253
if by is not None :
0 commit comments