10000 Improve docs · matplotlib/matplotlib@bfcb214 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfcb214

Browse files
committed
Improve docs
1 parent 5c4929e commit bfcb214

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

doc/api/axes_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Basic
5656
Axes.bar
5757
Axes.barh
5858
Axes.bar_label
59+
Axes.grouped_bar
5960

6061
Axes.stem
6162
Axes.eventplot

galleries/examples/lines_bars_and_markers/grouped_bar_chart.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
Grouped bar chart
44
=================
55
6-
This example serves to develop and discuss the API. It's geared towards illustating
6+
This example serves to showcase and discuss the API. It's geared towards illustating
77
API usage and design decisions only through the development phase. It's not intended
88
to go into the final PR in this form.
99
10+
Input data formats
11+
==================
12+
1013
Case 1: multiple separate datasets
1114
----------------------------------
1215
@@ -36,6 +39,7 @@
3639
# note also that this is a straight-forward generalization of the single-dataset case:
3740
# bar(x, data1, label="data1")
3841
axs[1].grouped_bar(x, [data1, data2, data3], labels=["data1", "data2", "data3"])
42+
axs[1].legend()
3943

4044

4145
# %%
@@ -58,8 +62,10 @@
5862

5963
# explicitly extract values and labels from a dict and feed to grouped_bar():
6064
axs[0].grouped_bar(x, datasets.values(), labels=datasets.keys())
65+
axs[0].legend()
6166
# accepting a dict as input
6267
axs[1].grouped_bar(x, datasets)
68+
axs[1].legend()
6369

6470
# %%
6571
# Case 2: 2D array data
@@ -122,7 +128,7 @@
122128

123129
# %%
124130
# Bar width and spacing
125-
# ---------------------
131+
# =====================
126132
# The center positions of the bar groups are given by x. We can still choose
127133
# two of the following properties: bar width, spacing between groups, and
128134
# spacing between bars.
@@ -147,7 +153,7 @@
147153

148154
# %%
149155
# Styling
150-
# -------
156+
# =======
151157
# The bars can be styled through additional keyword arguments. Currently,
152158
# the only per-dataset setting is ``colors``. Additionally, all
153159
# `.Rectangle` parameters are passed through and applied to all datasets.
@@ -166,7 +172,7 @@
166172

167173
# %%
168174
# Horizontal grouped bars
169-
# -----------------------
175+
# =======================
170176
# Use ``orientation="horizontal"`` to create horizontal grouped bar charts.
171177

172178
x = ['A', 'B', 'C']

0 commit comments

Comments
 (0)
0