@@ -1883,96 +1883,83 @@ def bar(self, *args, **kwargs):
1883
1883
1884
1884
(x - width/2, x + width/2, bottom, bottom + height)
1885
1885
1886
- (left, right, bottom and top edges) by default. *x*,
1887
- *height*, *width*, and *bottom* can be either scalars or
1888
- sequences.
1886
+ (left, right, bottom and top edges) by default. *x*, *height*,
1887
+ *width*, and *bottom* may be either scalars or sequences of length N.
1889
1888
1890
- The *align* and *orientation* kwargs control the interpretation of *x*
1891
- and *bottom*
1892
-
1893
- The *align* keyword-only argument controls if *x* is interpreted
1894
- as the center or the left edge of the rectangle.
1895
1889
1896
1890
Parameters
1897
1891
----------
1898
1892
x : sequence of scalars
1899
- the x coordinates of the bars.
1900
-
1901
- *align* controls if *x* is the bar center (default) or
1902
- left edge.
1893
+ The x coordinates of the bars. See also *align* for the
1894
+ alignment of the bars to the coordinates.
1903
1895
1904
1896
height : scalar or sequence of scalars
1905
- the height(s) of the bars
1897
+ The height(s) of the bars.
1906
1898
1907
1899
width : scalar or array-like, optional
1908
- the width(s) of the bars
1909
- default: 0.8
1900
+ The width(s) of the bars (default: 0.8).
1910
1901
1911
1902
bottom : scalar or array-like, optional
1912
- the y coordinate(s) of the bars
1913
- default: None
1903
+ The y coordinate(s) of the bars bases (default: 0).
1914
1904
1915
1905
align : {'center', 'edge'}, optional, default: 'center'
1916
- If 'center', interpret the *x* argument as the coordinates
1917
- of the centers of the bars. If 'edge', aligns bars by
1918
- their left edges
1906
+ Alignment of the bars to the *x* coordinates:
1919
1907
1920
- To align the bars on the right edge pass a negative
1921
- *width* and ``align='edge'``
1908
+ - 'center': Center the base on the *x* positions.
1909
+ - 'edge': Align the left edges of the bars with the *x* positions.
1910
+
1911
+ To align the bars on the right edge pass a negative *width* and
1912
+ ``align='edge'``.
1922
1913
1923
1914
Returns
1924
1915
-------
1925
- bars : matplotlib.container.BarContainer
1926
- Container with all of the bars + errorbars
1916
+ ` matplotlib.container.BarContainer`
1917
+ Container with all the bars and optionally errorbars.
1927
1918
1928
1919
Other Parameters
1929
1920
----------------
1930
1921
color : scalar or array-like, optional
1931
- the colors of the bar faces
1922
+ The colors of the bar faces.
1932
1923
1933
1924
edgecolor : scalar or array-like, optional
1934
- the colors of the bar edges
1925
+ The colors of the bar edges.
1935
1926
1936
1927
linewidth : scalar or array-like, optional
1937
- width of bar edge(s). If None, use default
1938
- linewidth; If 0, don't draw edges.
1939
- default: None
1928
+ Width of the bar edge(s). If 0, don't draw edges.
1940
1929
1941
1930
tick_label : string or array-like, optional
1942
- the tick labels of the bars
1943
- default: None
1931
+ The tick labels of the bars.
1932
+ Default: None (Use default numeric labels.)
1933
+
1934
+ xerr, yerr : scalar or array-like of shape(N,) or shape(2,N), optional
1935
+ If not *None*, add horizontal / vertical errorbars to the bar tips.
1936
+ The values are +/- sizes relative to the data:
1944
1937
1945
- xerr : scalar or array-like, optional
1946
- if not None, will be used to generate errorbar(s) on the bar chart
1947
- default: None
1938
+ - scalar: symmetric +/- values for all bars
1939
+ - shape(N,): symmetric +/- values for each bar
1940
+ - shape(2,N): separate + and - values for each bar
1948
1941
1949
- yerr : scalar or array-like, optional
1950
- if not None, will be used to generate errorbar(s) on the bar chart
1951
- default: None
1942
+ Default: None
1952
1943
1953
- ecolor : scalar or array-like, optional
1954
- specifies the color of errorbar(s)
1955
- default: None
1944
+ ecolor : scalar or array-like, optional, default: 'black'
1945
+ The line color of the errorbars.
1956
1946
1957
1947
capsize : scalar, optional
1958
- determines the length in points of the error bar caps
1959
- default : None, which will take the value from the
1948
+ The length of the error bar caps in points.
1949
+ Default : None, which will take the value from the
1960
1950
``errorbar.capsize`` :data:`rcParam<matplotlib.rcParams>`.
1961
1951
1962
1952
error_kw : dict, optional
1963
- dictionary of kwargs to be passed to errorbar method. *ecolor* and
1964
- *capsize* may be specified here rather than as independent kwargs.
1953
+ Dictionary of kwargs to be passed to the `~.Axes.errorbar()`
1954
+ method. Values of *ecolor* or *capsize* defined here take
1955
+ precedence over the independent kwargs.
1965
1956
1966
- log : boolean, optional
1967
- If true, sets the axis to be log scale.
1968
- default: False
1957
+ log : bool, optional, default: False
1958
+ If *True*, set the y-axis to be log scale.
1969
1959
1970
1960
orientation : {'vertical', 'horizontal'}, optional
1971
-
1972
- This is for internal use, please do not directly use this,
1973
- call `barh` instead.
1974
-
1975
- The orientation of the bars.
1961
+ *This is for internal use only.* Please use `barh()` for
1962
+ horizontal bar plots. Default: 'vertical'.
1976
1963
1977
1964
See also
1978
1965
--------
@@ -2215,76 +2202,79 @@ def barh(self, *args, **kwargs):
2215
2202
(left, left + width, y - height/2, y + height/2)
2216
2203
2217
2204
(left, right, bottom and top edges) by default. *y*, *width*,
2218
- *height*, and *left* can be either scalars or sequences.
2219
-
2220
- The *align* keyword-only argument controls if *y* is interpreted
2221
- as the center or the bottom edge of the rectangle.
2205
+ *height*, and *left* can be either scalars or sequences of length N.
2222
2206
2223
2207
2224
2208
Parameters
2225
2209
----------
2226
2210
y : scalar or array-like
2227
- the y coordinate(s) of the bars
2228
-
2229
- *align* controls if *y* is the bar center (default)
2230
- or bottom edge.
2211
+ The y coordinates of the bars. See also *align* for the
2212
+ alignment of the bars to the coordinates.
2231
2213
2232
2214
width : scalar or array-like
2233
- the width(s) of the bars
2215
+ The width(s) of the bars.
2234
2216
2235
2217
height : sequence of scalars, optional, default: 0.8
2236
- the heights of the bars
2218
+ The heights of the bars.
2237
2219
2238
2220
left : sequence of scalars
2239
- the x coordinates of the left sides of the bars
2221
+ The x coordinates of the left sides of the bars (default: 0).
2240
2222
2241
2223
align : {'center', 'edge'}, optional, default: 'center'
2242
- If 'center', interpret the *y* argument as the coordinates
2243
- of the centers of the bars. If 'edge', aligns bars by
2244
- their bottom edges
2224
+ Alignment of the base to the *y* coordinates*:
2245
2225
2246
- To align the bars on the top edge pass a negative
2247
- *height* and ``align='edge'``
2226
+ - 'center': Center the bars on the *y* positions.
2227
+ - 'edge': Align the bottom edges of the bars with the *y*
2228
+ positions.
2229
+
2230
+ To align the bars on the top edge pass a negative *height* and
2231
+ ``align='edge'``.
2248
2232
2249
2233
Returns
2250
2234
-------
2251
- `matplotlib.patches.Rectangle` instances.
2235
+ `matplotlib.container.BarContainer`
2236
+ Container with all the bars and optionally errorbars.
2252
2237
2253
2238
Other Parameters
2254
2239
----------------
2255
2240
color : scalar or array-like, optional
2256
- the colors of the bars
2241
+ The colors of the bar faces.
2257
2242
2258
2243
edgecolor : scalar or array-like, optional
2259
- the colors of the bar edges
2244
+ The colors of the bar edges.
2260
2245
2261
- linewidth : scalar or array-like, optional, default: None
2262
- width of bar edge(s). If None, use default
2263
- linewidth; If 0, don't draw edges.
2246
+ linewidth : scalar or array-like, optional
2247
+ Width of the bar edge(s). If 0, don't draw edges.
2264
2248
2265
- tick_label : string or array-like, optional, default: None
2266
- the tick labels of the bars
2249
+ tick_label : string or array-like, optional
2250
+ The tick labels of the bars.
2251
+ Default: None (Use default numeric labels.)
2252
+
2253
+ xerr, yerr : scalar or array-like of shape(N,) or shape(2,N), optional
2254
+
1C6A
If not *None*, add horizontal / vertical errorbars to the bar tips.
2255
+ The values are +/- sizes relative to the data:
2267
2256
2268
- xerr : scalar or array-like, optional, default: None
2269
- if not None, will be used to generate errorbar(s) on the bar chart
2257
+ - scalar: symmetric +/- values for all bars
2258
+ - shape(N,): symmetric +/- values for each bar
2259
+ - shape(2,N): separate + and - values for each bar
2270
2260
2271
- yerr : scalar or array-like, optional, default: None
2272
- if not None, will be used to generate errorbar(s) on the bar chart
2261
+ Default: None
2273
2262
2274
- ecolor : scalar or array-like, optional, default: None
2275
- specifies the color of errorbar(s)
2263
+ ecolor : scalar or array-like, optional, default: 'black'
2264
+ The line color of the errorbars.
2276
2265
2277
2266
capsize : scalar, optional
2278
- determines the length in points of the error bar caps
2279
- default : None, which will take the value from the
2267
+ The length of the error bar caps in points.
2268
+ Default : None, which will take the value from the
2280
2269
``errorbar.capsize`` :data:`rcParam<matplotlib.rcParams>`.
2281
2270
2282
- error_kw :
2283
- dictionary of kwargs to be passed to errorbar method. `ecolor` and
2284
- `capsize` may be specified here rather than as independent kwargs.
2271
+ error_kw : dict, optional
2272
+ Dictionary of kwargs to be passed to the `~.Axes.errorbar()`
2273
+ method. Values of *ecolor* or *capsize* defined here take
2274
+ precedence over the independent kwargs.
2285
2275
2286
- log : boolean , optional, default: False
2287
- If true, sets the axis to be log scale
2276
+ log : bool , optional, default: False
2277
+ If *True*, set the x- axis to be log scale.
2288
2278
2289
2279
See also
2290
2280
--------
0 commit comments