Skip to content

Commit 4ebcc78

Browse files
Explain widths behavior for standard and grouped bar plots
1 parent b8fcde9 commit 4ebcc78

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

doc/release/next_whats_new/new_barcontainer_properties.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
``BarContainer`` properties and attributes
22
------------------------------------------
33

4-
`.BarContainer` gained a new `~.BarContainer.widths` property.
4+
`.BarContainer` gained a new `~.BarContainer.widths` property. It returns a
5+
list of the widths of the individual bars in the container (the dimension
6+
perpendicular to the bar height).
7+
8+
For standard bar plots (e.g. created by `.Axes.bar` or `.Axes.barh`), this
9+
reflects the width of each bar in the plot. For grouped bar plots (e.g. created
10+
by `.Axes.grouped_bar`), each `~.BarContainer` represents a single dataset
11+
across all groups, so `~.BarContainer.widths` returns the width of each
12+
individual bar in that series, rather than the total width of the entire group.
513

614
Additionally, `.BarContainer` gained a new ``group_positions`` attribute, which
715
exposes the center positions of the bar groups if the container is part of a

0 commit comments

Comments
 (0)