Skip to content

Commit

Permalink
add example to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jukent committed Jan 17, 2024
1 parent 111e320 commit 54ffaee
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion docs/examples/set_titles_and_labels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Create plot\n",
"# Create plot with a subtitle\n",
"\n",
"# Create a figure\n",
"fig, ax = plt.subplots()\n",
Expand All @@ -55,6 +55,35 @@
"gv.set_titles_and_labels(ax,\n",
" maintitle=\"Title\",\n",
" maintitlefontsize=24,\n",
" subtitle=\"Subtitle\"\n",
" xlabel=\"x\",\n",
" ylabel=\"y\",\n",
" labelfontsize=16)\n",
"\n",
"# Show the plot\n",
"plt.show();"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Create plot with left and right subtitles\n",
"\n",
"# Create a figure\n",
"fig, ax = plt.subplots()\n",
"\n",
"# Plot the example data\n",
"ax.plot(x, y)\n",
"\n",
"# Use geocat.viz.util convenience function to set titles and labels\n",
"gv.set_titles_and_labels(ax,\n",
" maintitle=\"Title\",\n",
" maintitlefontsize=24,\n",
" leftitle=\"Left title\"\n",
" righttitle='Right title'\n",
" xlabel=\"x\",\n",
" ylabel=\"y\",\n",
" labelfontsize=16)\n",
Expand Down

0 comments on commit 54ffaee

Please sign in to comment.