@@ -1753,7 +1753,7 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
1753
1753
xerr : scalar or array-like, optional, default: None
1754
1754
if not None, will be used to generate errorbar(s) on the bar chart
1755
1755
1756
- yerr :scalar or array-like, optional, default: None
1756
+ yerr : scalar or array-like, optional, default: None
1757
1757
if not None, will be used to generate errorbar(s) on the bar chart
1758
1758
1759
1759
ecolor : scalar or array-like, optional, default: None
@@ -1779,7 +1779,7 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
1779
1779
1780
1780
Returns
1781
1781
-------
1782
- :class: `matplotlib.patches.Rectangle` instances.
1782
+ `matplotlib.patches.Rectangle` instances.
1783
1783
1784
1784
Notes
1785
1785
-----
@@ -1795,6 +1795,13 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
1795
1795
1796
1796
%(Rectangle)s
1797
1797
1798
+ See also
1799
+ --------
1800
+ barh: Plot a horizontal bar plot.
1801
+
1802
+ Example
1803
+ -------
1804
+
1798
1805
**Example:** A stacked bar chart.
1799
1806
1800
1807
.. plot:: mpl_examples/pylab_examples/bar_stacked.py
@@ -2007,68 +2014,88 @@ def barh(self, bottom, width, height=0.8, left=None, **kwargs):
2007
2014
"""
2008
2015
Make a horizontal bar plot.
2009
2016
2010
- Call signature::
2011
-
2012
- barh(bottom, width, height=0.8, left=0, **kwargs)
2013
-
2014
2017
Make a horizontal bar plot with rectangles bounded by:
2015
2018
2016
- * left*, * left* + * width*, * bottom*, * bottom* + * height*
2019
+ ` left`, ` left` + ` width`, ` bottom`, ` bottom` + ` height`
2017
2020
(left, right, bottom and top edges)
2018
2021
2019
- * bottom*, * width*, * height* , and * left* can be either scalars
2022
+ ` bottom`, ` width`, ` height` , and ` left` can be either scalars
2020
2023
or sequences
2021
2024
2022
- Return value is a list of
2023
- :class:`matplotlib.patches.Rectangle` instances.
2025
+ Parameters
2026
+ ----------
2027
+ bottom : scalar or array-like
2028
+ the y coordinate(s) of the bars
2024
2029
2025
- Required arguments:
2030
+ width : scalar or array-like
2031
+ the width(s) of the bars
2026
2032
2027
- ======== ======================================================
2028
- Argument Description
2029
- ======== ======================================================
2030
- *bottom* the vertical positions of the bottom edges of the bars
2031
- *width* the lengths of the bars
2032
- ======== ======================================================
2033
+ height : sequence of scalars, optional, default: 0.8
2034
+ the heights of the bars
2033
2035
2034
- Optional keyword arguments:
2036
+ left : sequence of scalars
2037
+ the x coordinates of the left sides of the bars
2035
2038
2036
- =============== ==========================================
2037
- Keyword Description
2038
- =============== ==========================================
2039
- *height* the heights (thicknesses) of the bars
2040
- *left* the x coordinates of the left edges of the
2041
- bars
2042
- *color* the colors of the bars
2043
- *edgecolor* the colors of the bar edges
2044
- *linewidth* width of bar edges; None means use default
2045
- linewidth; 0 means don't draw edges.
2046
- *xerr* if not None, will be used to generate
2047
- errorbars on the bar chart
2048
- *yerr* if not None, will be used to generate
2049
- errorbars on the bar chart
2050
- *ecolor* specifies the color of any errorbar
2051
- *capsize* (default 3) determines the length in
2052
- points of the error bar caps
2053
- *align* 'edge' (default) | 'center'
2054
- *log* [False|True] False (default) leaves the
2055
- horizontal axis as-is; True sets it to log
2056
- scale
2057
- =============== ==========================================
2058
-
2059
- Setting *align* = 'edge' aligns bars by their bottom edges in
2060
- bottom, while *align* = 'center' interprets these values as
2061
- the *y* coordinates of the bar centers.
2062
-
2063
- The optional arguments *color*, *edgecolor*, *linewidth*,
2064
- *xerr*, and *yerr* can be either scalars or sequences of
2039
+ Returns
2040
+ --------
2041
+ `matplotlib.patches.Rectangle` instances.
2042
+
2043
+ Other parameters
2044
+ ----------------
2045
+ color : scalar or array-like, optional
2046
+ the colors of the bars
2047
+
2048
+ edgecolor : scalar or array-like, optional
2049
+ the colors of the bar edges
2050
+
2051
+ linewidth : scalar or array-like, optional, default: None
2052
+ width of bar edge(s). If None, use default
2053
+ linewidth; If 0, don't draw edges.
2054
+
2055
+ xerr : scalar or array-like, optional, default: None
2056
+ if not None, will be used to generate errorbar(s) on the bar chart
2057
+
2058
+ yerr : scalar or array-like, optional, default: None
2059
+ if not None, will be used to generate errorbar(s) on the bar chart
2060
+
2061
+ ecolor : scalar or array-like, optional, default: None
2062
+ specifies the color of errorbar(s)
2063
+
2064
+ capsize : integer, optional, default: 3
2065
+ determines the length in points of the error bar caps
2066
+
2067
+ error_kw :
2068
+ dictionary of kwargs to be passed to errorbar method. `ecolor` and
2069
+ `capsize` may be specified here rather than as independent kwargs.
2070
+
2071
+ align : ['edge' | 'center'], optional, default: 'edge'
2072
+ If `edge`, aligns bars by their left edges (for vertical bars) and
2073
+ by their bottom edges (for horizontal bars). If `center`, interpret
2074
+ the `left` argument as the coordinates of the centers of the bars.
2075
+
2076
+ orientation : 'vertical' | 'horizontal', optional, default: 'vertical'
2077
+ The orientation of the bars.
2078
+
2079
+ log : boolean, optional, default: False
2080
+ If true, sets the axis to be log scale
2081
+
2082
+ Notes
2083
+ -----
2084
+ The optional arguments `color`, `edgecolor`, `linewidth`,
2085
+ `xerr`, and `yerr` can be either scalars or sequences of
2065
2086
length equal to the number of bars. This enables you to use
2066
- barh as the basis for stacked bar charts, or candlestick
2067
- plots.
2087
+ bar as the basis for stacked bar charts, or candlestick plots.
2088
+ Detail: `xerr` and `yerr` are passed directly to
2089
+ :meth:`errorbar`, so they can also have shape 2xN for
2090
+ independent specification of lower and upper errors.
2068
2091
2069
- other optional kwargs:
2092
+ Other optional kwargs:
2070
2093
2071
2094
%(Rectangle)s
2095
+
2096
+ See also
2097
+ --------
2098
+ bar: Plot a vertical bar plot.
2072
2099
"""
2073
2100
2074
2101
patches = self .bar (left = left , height = height , width = width ,
0 commit comments