@@ -3057,9 +3057,9 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
3057
3057
3058
3058
.. code-block:: python
3059
3059
3060
- grouped_bar([dataset_1, dataset_2, dataset_3 ],
3060
+ grouped_bar([dataset_0, dataset_1, dataset_2 ],
3061
3061
tick_labels=['A', 'B'],
3062
- labels=['dataset 1 ', 'dataset 2 ', 'dataset 3 '])
3062
+ labels=['dataset 0 ', 'dataset 1 ', 'dataset 2 '])
3063
3063
3064
3064
.. plot:: _embedded_plots/grouped_bar.py
3065
3065
@@ -3156,13 +3156,13 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
3156
3156
These will show up in the legend.
3157
3157
3158
3158
group_spacing : float, default: 1.5
3159
- The space between two bar groups as multiples of bar width.
3159
+ The space between two bar groups as a multiple of bar width.
3160
3160
3161
3161
The default value of 1.5 thus means that there's a gap of
3162
3162
1.5 bar widths between bar groups.
3163
3163
3164
3164
bar_spacing : float, default: 0
3165
- The space between bars as multiples of bar width.
3165
+ The space between bars as a multiple of bar width.
3166
3166
3167
3167
orientation : {"vertical", "horizontal"}, default: "vertical"
3168
3168
The direction of the bars.
@@ -3181,17 +3181,17 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
3181
3181
3182
3182
Returns
3183
3183
-------
3184
- _GroupedBarReturn
3184
+ _GroupedBarReturn
3185
3185
3186
- A provisional result object. This will be refined in the future.
3187
- For now, the guaranteed API on the returned object is limited to
3186
+ A provisional result object. This will be refined in the future.
3187
+ For now, the guaranteed API on the returned object is limited to
3188
3188
3189
- - the attribute ``bar_containers``, which is a list of
3190
- `.BarContainer`, i.e. the results of the individual `~.Axes.bar`
3191
- calls for each dataset.
3189
+ - the attribute ``bar_containers``, which is a list of
3190
+ `.BarContainer`, i.e. the results of the individual `~.Axes.bar`
3191
+ calls for each dataset.
3192
3192
3193
- - a ``remove()`` method, that remove all bars from the Axes.
3194
- See also `.Artist.remove()`.
3193
+ - a ``remove()`` method, that remove all bars from the Axes.
3194
+ See also `.Artist.remove()`.
3195
3195
3196
3196
See Also
3197
3197
--------
@@ -3261,8 +3261,7 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
3261
3261
heights = heights .to_numpy ().T
3262
3262
elif hasattr (heights , 'keys' ): # dict
3263
3263
if labels is not None :
3264
- raise ValueError (
3265
- "'labels' cannot be used if 'heights' are a mapping" )
3264
+ raise ValueError ("'labels' cannot be used if 'heights' is a mapping" )
3266
3265
labels = heights .keys ()
3267
3266
heights = list (heights .values ())
3268
3267
elif hasattr (heights , 'shape' ): # numpy array
@@ -3317,8 +3316,7 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
3317
3316
# place the bars, but only use numerical positions, categorical tick labels
3318
3317
# are handled separately below
3319
3318
bar_containers = []
3320
- for i , (hs , label , color ) in enumerate (
3321
- zip (heights , labels , colors )):
3319
+ for i , (hs , label , color ) in enumerate (zip (heights , labels , colors )):
3322
3320
lefts = (group_centers - 0.5 * group_distance + margin_abs
3323
3321
+ i * (bar_width + bar_spacing_abs ))
3324
3322
if orientation == "vertical" :
0 commit comments