@@ -4288,6 +4288,10 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
42884288 *ecolor* specifies the color of any errorbar
42894289 *capsize* (default 3) determines the length in
42904290 points of the error bar caps
4291+ *error_kw* dictionary of kwargs to be passed to
4292+ errorbar method. *ecolor* and *capsize*
4293+ may be specified here rather than as
4294+ independent kwargs.
42914295 *align* 'edge' (default) | 'center'
42924296 *orientation* 'vertical' | 'horizontal'
42934297 *log* [False|True] False (default) leaves the
@@ -4322,13 +4326,18 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
43224326 color = kwargs .pop ('color' , None )
43234327 edgecolor = kwargs .pop ('edgecolor' , None )
43244328 linewidth = kwargs .pop ('linewidth' , None )
4329+
43254330 # Because xerr and yerr will be passed to errorbar,
43264331 # most dimension checking and processing will be left
43274332 # to the errorbar method.
43284333 xerr = kwargs .pop ('xerr' , None )
43294334 yerr = kwargs .pop ('yerr' , None )
4335+ error_kw = kwargs .pop ('error_kw' , dict ())
43304336 ecolor = kwargs .pop ('ecolor' , None )
43314337 capsize = kwargs .pop ('capsize' , 3 )
4338+ error_kw .setdefault ('ecolor' , ecolor )
4339+ error_kw .setdefault ('capsize' , capsize )
4340+
43324341 align = kwargs .pop ('align' , 'edge' )
43334342 orientation = kwargs .pop ('orientation' , 'vertical' )
43344343 log = kwargs .pop ('log' , False )
@@ -4478,7 +4487,7 @@ def make_iterable(x):
44784487 self .errorbar (
44794488 x , y ,
44804489 yerr = yerr , xerr = xerr ,
4481- fmt = None , ecolor = ecolor , capsize = capsize )
4490+ fmt = None , ** error_kw )
44824491
44834492 self .hold (holdstate ) # restore previous hold state
44844493
@@ -4833,17 +4842,17 @@ def errorbar(self, x, y, yerr=None, xerr=None,
48334842 If a scalar number, len(N) array-like object, or an Nx1 array-like
48344843 object, errorbars are drawn +/- value.
48354844
4836- If a rank-1, 2xN numpy array , errorbars are drawn at -row1 and
4845+ If a sequence of shape 2xN , errorbars are drawn at -row1 and
48374846 +row2
48384847
48394848 *fmt*: '-'
4840- The plot format symbol for *y* . If *fmt* is *None*, just plot the
4841- errorbars with no line symbols . This can be useful for creating a
4842- bar plot with errorbars .
4849+ The plot format symbol. If *fmt* is *None*, only the
4850+ errorbars are plotted . This is used for adding
4851+ errorbars to a bar plot, for example .
48434852
48444853 *ecolor*: [ None | mpl color ]
4845- a matplotlib color arg which gives the color the errorbar lines; if
4846- *None*, use the marker color.
4854+ a matplotlib color arg which gives the color the errorbar lines;
4855+ if *None*, use the marker color.
48474856
48484857 *elinewidth*: scalar
48494858 the linewidth of the errorbar lines. If *None*, use the linewidth.
@@ -4862,8 +4871,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
48624871 type as *xerr* and *yerr*.
48634872
48644873 All other keyword arguments are passed on to the plot command for the
4865- markers, so you can add additional key=value pairs to control the
4866- errorbar markers. For example, this code makes big red squares with
4874+ markers, For example, this code makes big red squares with
48674875 thick green edges::
48684876
48694877 x,y,yerr = rand(3,10)
@@ -4878,12 +4886,16 @@ def errorbar(self, x, y, yerr=None, xerr=None,
48784886
48794887 %(Line2D)s
48804888
4881- Return value is a length 3 tuple. The first element is the
4882- :class:`~matplotlib.lines.Line2D` instance for the *y* symbol
4883- lines. The second element is a list of error bar cap lines,
4884- the third element is a list of
4885- :class:`~matplotlib.collections.LineCollection` instances for
4886- the horizontal and vertical error ranges.
4889+ Returns (*plotline*, *caplines*, *barlinecols*):
4890+
4891+ *plotline*: :class:`~matplotlib.lines.Line2D` instance
4892+ *x*, *y* plot markers and/or line
4893+
4894+ *caplines*: list of error bar cap
4895+ :class:`~matplotlib.lines.Line2D` instances
4896+ *barlinecols*: list of
4897+ :class:`~matplotlib.collections.LineCollection` instances for
4898+ the horizontal and vertical error ranges.
48874899
48884900 **Example:**
48894901
0 commit comments