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