Skip to content

Commit 4ee9221

Browse files
committed
DOC: use arr.plot(subplots=...) instead of doing that manually via plt.subplots
1 parent 8619274 commit 4ee9221

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

doc/source/tutorial/tutorial_plotting.ipynb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
"cell_type": "markdown",
212212
"metadata": {},
213213
"source": [
214-
"Create a multiplot figure (using `plt.subplot(nrows,ncols,index)`):"
214+
"Create a multiplot figure (using `subplots=axes`):"
215215
]
216216
},
217217
{
@@ -220,13 +220,9 @@
220220
"metadata": {},
221221
"outputs": [],
222222
"source": [
223-
"figure, axes = plt.subplots(nrows=len(population.country), ncols=1, sharex=True, figsize=(5, 15))\n",
224-
"\n",
225-
"for row, c in enumerate(population.country): \n",
226-
" population[c].plot(ax=axes[row], title=str(c))\n",
227-
" plt.ylabel('population (millions)')\n",
228-
" \n",
229-
"plt.xticks(population.time)\n",
223+
"population.plot(subplots=('country', 'gender'), sharex=True, \n",
224+
" xticks=population.time, ylabel='population (millions)',\n",
225+
" figsize=(8, 10))\n",
230226
"plt.show()"
231227
]
232228
},

0 commit comments

Comments
 (0)