-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional usage examples and update a thumbnail (#181)
* new thumbnail for plot_contour_labels * add usage examples and thumbnails * oops add to examples.rst as well * update release notes
- Loading branch information
1 parent
21a18e5
commit 41027d5
Showing
8 changed files
with
188 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# `set_axes_limits_and_ticks`\n", | ||
"\n", | ||
"This notebook is a simple example of the GeoCAT-viz function <a href=\"../user_api/generated/geocat.viz.util.set_axes_limits_and_ticks.html#geocat-viz.util.set_axes_limits_and_ticks\">set_axes_limits_and_ticks</a>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Import packages:\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"import geocat.viz as gv" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Generate example data:\n", | ||
"\n", | ||
"npts = 500\n", | ||
"\n", | ||
"x = 500 + 0.9 * np.arange(0, npts) * np.cos(np.pi / 100 * np.arange(0, npts))\n", | ||
"y = 500 + 0.9 * np.arange(0, npts) * np.sin(np.pi / 100 * np.arange(0, npts))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Create plot\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 axes limits and tick labels\n", | ||
"gv.set_axes_limits_and_ticks(ax,\n", | ||
" xlim=(0, 900),\n", | ||
" ylim=(100, 1000),\n", | ||
" xticks=range(0, 901, 100),\n", | ||
" yticks=range(100, 1001, 100))\n", | ||
"\n", | ||
"# Show the plot\n", | ||
"plt.show();" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# `set_titles_and_labels`\n", | ||
"\n", | ||
"This notebook is a simple example of the GeoCAT-viz function <a href=\"../user_api/generated/geocat.viz.util.set_titles_and_labels.html#geocat-viz.util.set_titles_and_labels\">set_titles_and_labels</a>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Import packages:\n", | ||
"\n", | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"import geocat.viz as gv" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Generate example data:\n", | ||
"\n", | ||
"npts = 500\n", | ||
"\n", | ||
"x = 500 + 0.9 * np.arange(0, npts) * np.cos(np.pi / 100 * np.arange(0, npts))\n", | ||
"y = 500 + 0.9 * np.arange(0, npts) * np.sin(np.pi / 100 * np.arange(0, npts))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Create plot\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", | ||
" xlabel=\"x\",\n", | ||
" ylabel=\"y\",\n", | ||
" labelfontsize=16)\n", | ||
"\n", | ||
"# Show the plot\n", | ||
"plt.show();" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters