@@ -2391,6 +2391,17 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
23912391 The x coordinates of the bars. See also *align* for the
23922392 alignment of the bars to the coordinates.
23932393
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+
23942405 height : float or array-like
23952406 The height(s) of the bars.
23962407
@@ -2706,6 +2717,17 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
27062717 The y coordinates of the bars. See also *align* for the
27072718 alignment of the bars to the coordinates.
27082719
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+
27092731 width : float or array-like
27102732 The width(s) of the bars.
27112733
0 commit comments