@@ -2386,6 +2386,17 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2386
2386
The x coordinates of the bars. See also *align* for the
2387
2387
alignment of the bars to the coordinates.
2388
2388
2389
+ Bars are often used for categorical data, i.e. string labels below
2390
+ the bars. You can provide a list of strings directly to *x*.
2391
+ ``bar(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
2392
+ convenient notation compared to
2393
+ ``bar(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
2394
+ equivalent as long as the names are unique. The explicit *tick_label*
2395
+ notation draws the names in the sequence given. However, when having
2396
+ duplicate values in categorical *x* data, these values map to the same
2397
+ numerical x coordinate, and hence the corresponding bars are drawn on
2398
+ top of each other.
2399
+
2389
2400
height : float or array-like
2390
2401
The height(s) of the bars.
2391
2402
@@ -2701,6 +2712,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
2701
2712
The y coordinates of the bars. See also *align* for the
2702
2713
alignment of the bars to the coordinates.
2703
2714
2715
+ Bars are often used for categorical data, i.e. string labels below
2716
+ the bars. You can provide a list of strings directly to *y*.
2717
+ ``bar(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
2718
+ convenient notation compared to
2719
+ ``bar(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
2720
+ equivalent as long as the names are unique. The explicit *tick_label*
2721
+ notation draws the names in the sequence given. However, when having
2722
+ duplicate values in categorical *y* data, these values map to the same
2723
+ numerical y coordinate, and hence the corresponding bars are drawn on
2724
+ top of each other.
2725
+
2704
2726
width : float or array-like
2705
2727
The width(s) of the bars.
2706
2728
0 commit comments