From 54ffaeeb20e996294806efd4f068fb054d54d511 Mon Sep 17 00:00:00 2001 From: Julia Kent <46687291+jukent@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:26:54 -0700 Subject: [PATCH] add example to documentation --- docs/examples/set_titles_and_labels.ipynb | 31 ++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/examples/set_titles_and_labels.ipynb b/docs/examples/set_titles_and_labels.ipynb index 78343c7..194372a 100644 --- a/docs/examples/set_titles_and_labels.ipynb +++ b/docs/examples/set_titles_and_labels.ipynb @@ -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", @@ -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",