@@ -2228,7 +2228,7 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2228
2228
The width(s) of the bars.
2229
2229
2230
2230
bottom : float or array-like, default: 0
2231
- The y coordinate(s) of the bars bases .
2231
+ The y coordinate(s) of the bottom side(s) of the bars .
2232
2232
2233
2233
align : {'center', 'edge'}, default: 'center'
2234
2234
Alignment of the bars to the *x* coordinates:
@@ -2278,8 +2278,8 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2278
2278
errors.
2279
2279
- *None*: No errorbar. (Default)
2280
2280
2281
- See :doc:`/gallery/statistics/errorbar_features`
2282
- for an example on the usage of `` xerr`` and `` yerr`` .
2281
+ See :doc:`/gallery/statistics/errorbar_features` for an example on
2282
+ the usage of * xerr* and * yerr* .
2283
2283
2284
2284
ecolor : color or list of color, default: 'black'
2285
2285
The line color of the errorbars.
@@ -2288,9 +2288,9 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2288
2288
The length of the error bar caps in points.
2289
2289
2290
2290
error_kw : dict, optional
2291
- Dictionary of kwargs to be passed to the `~.Axes.errorbar`
2292
- method. Values of *ecolor* or *capsize* defined here take
2293
- precedence over the independent kwargs .
2291
+ Dictionary of keyword arguments to be passed to the
2292
+ `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
2293
+ here take precedence over the independent keyword arguments .
2294
2294
2295
2295
log : bool, default: False
2296
2296
If *True*, set the y-axis to be log scale.
@@ -2498,9 +2498,10 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2498
2498
2499
2499
return bar_container
2500
2500
2501
+ # @_preprocess_data() # let 'bar' do the unpacking..
2501
2502
@_docstring .dedent_interpd
2502
2503
def barh (self , y , width , height = 0.8 , left = None , * , align = "center" ,
2503
- ** kwargs ):
2504
+ data = None , ** kwargs ):
2504
2505
r"""
2505
2506
Make a horizontal bar plot.
2506
2507
@@ -2524,7 +2525,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2524
2525
The heights of the bars.
2525
2526
2526
2527
left : float or array-like, default: 0
2527
- The x coordinates of the left sides of the bars.
2528
+ The x coordinates of the left side(s) of the bars.
2528
2529
2529
2530
align : {'center', 'edge'}, default: 'center'
2530
2531
Alignment of the base to the *y* coordinates*:
@@ -2556,9 +2557,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2556
2557
The tick labels of the bars.
2557
2558
Default: None (Use default numeric labels.)
2558
2559
2560
+ label : str or list of str, optional
2561
+ A single label is attached to the resulting `.BarContainer` as a
2562
+ label for the whole dataset.
2563
+ If a list is provided, it must be the same length as *y* and
2564
+ labels the individual bars. Repeated labels are not de-duplicated
2565
+ and will cause repeated label entries, so this is best used when
2566
+ bars also differ in style (e.g., by passing a list to *color*.)
2567
+
2559
2568
xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
2560
- If not `` None`` , add horizontal / vertical errorbars to the
2561
- bar tips. The values are +/- sizes relative to the data:
2569
+ If not * None* , add horizontal / vertical errorbars to the bar tips.
2570
+ The values are +/- sizes relative to the data:
2562
2571
2563
2572
- scalar: symmetric +/- values for all bars
2564
2573
- shape(N,): symmetric +/- values for each bar
@@ -2567,8 +2576,8 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2567
2576
errors.
2568
2577
- *None*: No errorbar. (default)
2569
2578
2570
- See :doc:`/gallery/statistics/errorbar_features`
2571
- for an example on the usage of `` xerr`` and `` yerr`` .
2579
+ See :doc:`/gallery/statistics/errorbar_features` for an example on
2580
+ the usage of * xerr* and * yerr* .
2572
2581
2573
2582
ecolor : color or list of color, default: 'black'
2574
2583
The line color of the errorbars.
@@ -2577,13 +2586,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2577
2586
The length of the error bar caps in points.
2578
2587
2579
2588
error_kw : dict, optional
2580
- Dictionary of kwargs to be passed to the `~.Axes.errorbar`
2581
- method. Values of *ecolor* or *capsize* defined here take
2582
- precedence over the independent kwargs .
2589
+ Dictionary of keyword arguments to be passed to the
2590
+ `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
2591
+ here take precedence over the independent keyword arguments .
2583
2592
2584
2593
log : bool, default: False
2585
2594
If ``True``, set the x-axis to be log scale.
2586
2595
2596
+ data : indexable object, optional
2597
+ If given, all parameters also accept a string ``s``, which is
2598
+ interpreted as ``data[s]`` (unless this raises an exception).
2599
+
2587
2600
**kwargs : `.Rectangle` properties
2588
2601
2589
2602
%(Rectangle:kwdoc)s
@@ -2596,12 +2609,11 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2596
2609
-----
2597
2610
Stacked bars can be achieved by passing individual *left* values per
2598
2611
bar. See
2599
- :doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`
2600
- .
2612
+ :doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`.
2601
2613
"""
2602
2614
kwargs .setdefault ('orientation' , 'horizontal' )
2603
2615
patches = self .bar (x = left , height = height , width = width , bottom = y ,
2604
- align = align , ** kwargs )
2616
+ align = align , data = data , ** kwargs )
2605
2617
return patches
2606
2618
2607
2619
def bar_label (self , container , labels = None , * , fmt = "%g" , label_type = "edge" ,
0 commit comments