OSGeoLive-Notebooks/Cartopy/cartopy-tissot.ipynb

77 lines
1.4 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"import cartopy.crs as ccrs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"def main():\n",
" fig = plt.figure(figsize=(10, 5))\n",
" ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())\n",
"\n",
" # make the map global rather than have it zoom in to\n",
" # the extents of any plotted data\n",
" ax.set_global()\n",
"\n",
" ax.stock_img()\n",
" ax.coastlines()\n",
"\n",
" ax.tissot(facecolor='orange', alpha=0.4)\n",
"\n",
" plt.show()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"main()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}