@@ -2272,26 +2272,25 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2272
2272
Make a bar plot.
2273
2273
2274
2274
The bars are positioned at *x* with the given *align*\ment. Their
2275
- dimensions are given by *width * and *height *. The vertical baseline
2275
+ dimensions are given by *height * and *width *. The vertical baseline
2276
2276
is *bottom* (default 0).
2277
2277
2278
- Each of *x*, *height*, *width*, and *bottom* may either be a scalar
2279
- applying to all bars, or it may be a sequence of length N providing a
2280
- separate value for each bar.
2278
+ Many parameters can take either a single value applying to all bars
2279
+ or a sequence of values, one for each bar.
2281
2280
2282
2281
Parameters
2283
2282
----------
2284
- x : sequence of scalars
2283
+ x : float or array-like
2285
2284
The x coordinates of the bars. See also *align* for the
2286
2285
alignment of the bars to the coordinates.
2287
2286
2288
- height : scalar or sequence of scalars
2287
+ height : float or array-like
2289
2288
The height(s) of the bars.
2290
2289
2291
- width : scalar or array-like, default: 0.8
2290
+ width : float or array-like, default: 0.8
2292
2291
The width(s) of the bars.
2293
2292
2294
- bottom : scalar or array-like, default: 0
2293
+ bottom : float or array-like, default: 0
2295
2294
The y coordinate(s) of the bars bases.
2296
2295
2297
2296
align : {'center', 'edge'}, default: 'center'
@@ -2310,20 +2309,20 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2310
2309
2311
2310
Other Parameters
2312
2311
----------------
2313
- color : scalar or array-like , optional
2312
+ color : color or list of color , optional
2314
2313
The colors of the bar faces.
2315
2314
2316
- edgecolor : scalar or array-like , optional
2315
+ edgecolor : color or list of color , optional
2317
2316
The colors of the bar edges.
2318
2317
2319
- linewidth : scalar or array-like, optional
2318
+ linewidth : float or array-like, optional
2320
2319
Width of the bar edge(s). If 0, don't draw edges.
2321
2320
2322
- tick_label : str or array-like , optional
2321
+ tick_label : str or list of str , optional
2323
2322
The tick labels of the bars.
2324
2323
Default: None (Use default numeric labels.)
2325
2324
2326
- xerr, yerr : scalar or array-like of shape(N,) or shape(2, N), optional
2325
+ xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
2327
2326
If not *None*, add horizontal / vertical errorbars to the bar tips.
2328
2327
The values are +/- sizes relative to the data:
2329
2328
@@ -2337,13 +2336,11 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2337
2336
See :doc:`/gallery/statistics/errorbar_features`
2338
2337
for an example on the usage of ``xerr`` and ``yerr``.
2339
2338
2340
- ecolor : scalar or array-like , default: 'black'
2339
+ ecolor : color or list of color , default: 'black'
2341
2340
The line color of the errorbars.
2342
2341
2343
- capsize : scalar, optional
2342
+ capsize : float, default: :rc:`errorbar.capsize`
2344
2343
The length of the error bar caps in points.
2345
- Default: None, which will take the value from
2346
- :rc:`errorbar.capsize`.
2347
2344
2348
2345
error_kw : dict, optional
2349
2346
Dictionary of kwargs to be passed to the `~.Axes.errorbar`
@@ -2357,23 +2354,18 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2357
2354
*This is for internal use only.* Please use `barh` for
2358
2355
horizontal bar plots. Default: 'vertical'.
2359
2356
2357
+ **kwargs : `.Rectangle` properties
2358
+
2359
+ %(Rectangle)s
2360
+
2360
2361
See Also
2361
2362
--------
2362
2363
barh: Plot a horizontal bar plot.
2363
2364
2364
2365
Notes
2365
2366
-----
2366
- The optional arguments *color*, *edgecolor*, *linewidth*,
2367
- *xerr*, and *yerr* can be either scalars or sequences of
2368
- length equal to the number of bars. This enables you to use
2369
- bar as the basis for stacked bar charts, or candlestick plots.
2370
- Detail: *xerr* and *yerr* are passed directly to
2371
- :meth:`errorbar`, so they can also have shape 2xN for
2372
- independent specification of lower and upper errors.
2373
-
2374
- Other optional kwargs:
2375
-
2376
- %(Rectangle)s
2367
+ Stacked bars can be achieved by passing individual *bottom* values per
2368
+ bar. See :doc:`/gallery/lines_bars_and_markers/bar_stacked`.
2377
2369
"""
2378
2370
kwargs = cbook .normalize_kwargs (kwargs , mpatches .Patch )
2379
2371
color = kwargs .pop ('color' , None )
@@ -2547,23 +2539,22 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2547
2539
dimensions are given by *width* and *height*. The horizontal baseline
2548
2540
is *left* (default 0).
2549
2541
2550
- Each of *y*, *width*, *height*, and *left* may either be a scalar
2551
- applying to all bars, or it may be a sequence of length N providing a
2552
- separate value for each bar.
2542
+ Many parameters can take either a single value applying to all bars
2543
+ or a sequence of values, one for each bar.
2553
2544
2554
2545
Parameters
2555
2546
----------
2556
- y : scalar or array-like
2547
+ y : float or array-like
2557
2548
The y coordinates of the bars. See also *align* for the
2558
2549
alignment of the bars to the coordinates.
2559
2550
2560
- width : scalar or array-like
2551
+ width : float or array-like
2561
2552
The width(s) of the bars.
2562
2553
2563
- height : sequence of scalars , default: 0.8
2554
+ height : float or array-like , default: 0.8
2564
2555
The heights of the bars.
2565
2556
2566
- left : sequence of scalars , default: 0
2557
+ left : float or array-like , default: 0
2567
2558
The x coordinates of the left sides of the bars.
2568
2559
2569
2560
align : {'center', 'edge'}, default: 'center'
@@ -2583,20 +2574,20 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2583
2574
2584
2575
Other Parameters
2585
2576
----------------
2586
- color : scalar or array-like , optional
2577
+ color : color or list of color , optional
2587
2578
The colors of the bar faces.
2588
2579
2589
- edgecolor : scalar or array-like , optional
2580
+ edgecolor : color or list of color , optional
2590
2581
The colors of the bar edges.
2591
2582
2592
- linewidth : scalar or array-like, optional
2583
+ linewidth : float or array-like, optional
2593
2584
Width of the bar edge(s). If 0, don't draw edges.
2594
2585
2595
- tick_label : str or array-like , optional
2586
+ tick_label : str or list of str , optional
2596
2587
The tick labels of the bars.
2597
2588
Default: None (Use default numeric labels.)
2598
2589
2599
- xerr, yerr : scalar or array-like of shape(N,) or shape(2, N), optional
2590
+ xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
2600
2591
If not ``None``, add horizontal / vertical errorbars to the
2601
2592
bar tips. The values are +/- sizes relative to the data:
2602
2593
@@ -2610,13 +2601,11 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2610
2601
See :doc:`/gallery/statistics/errorbar_features`
2611
2602
for an example on the usage of ``xerr`` and ``yerr``.
2612
2603
2613
- ecolor : scalar or array-like , default: 'black'
2604
+ ecolor : color or list of color , default: 'black'
2614
2605
The line color of the errorbars.
2615
2606
2616
- capsize : scalar, optional
2607
+ capsize : float, default: :rc:`errorbar.capsize`
2617
2608
The length of the error bar caps in points.
2618
- Default: None, which will take the value from
2619
- :rc:`errorbar.capsize`.
2620
2609
2621
2610
error_kw : dict, optional
2622
2611
Dictionary of kwargs to be passed to the `~.Axes.errorbar`
@@ -2626,23 +2615,20 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2626
2615
log : bool, default: False
2627
2616
If ``True``, set the x-axis to be log scale.
2628
2617
2618
+ **kwargs : `.Rectangle` properties
2619
+
2620
+ %(Rectangle)s
2621
+
2629
2622
See Also
2630
2623
--------
2631
2624
bar: Plot a vertical bar plot.
2632
2625
2633
2626
Notes
2634
2627
-----
2635
- The optional arguments *color*, *edgecolor*, *linewidth*,
2636
- *xerr*, and *yerr* can be either scalars or sequences of
2637
- length equal to the number of bars. This enables you to use
2638
- bar as the basis for stacked bar charts, or candlestick plots.
2639
- Detail: *xerr* and *yerr* are passed directly to
2640
- :meth:`errorbar`, so they can also have shape 2xN for
2641
- independent specification of lower and upper errors.
2642
-
2643
- Other optional kwargs:
2644
-
2645
- %(Rectangle)s
2628
+ Stacked bars can be achieved by passing individual *left* values per
2629
+ bar. See
2630
+ :doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`
2631
+ .
2646
2632
"""
2647
2633
kwargs .setdefault ('orientation' , 'horizontal' )
2648
2634
patches = self .bar (x = left , height = height , width = width , bottom = y ,
0 commit comments