.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_map.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_example_map.py: Plotting map =============== .. GENERATED FROM PYTHON SOURCE LINES 6-35 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /gallery/images/sphx_glr_example_map_001.png :alt: example map :srcset: /gallery/images/sphx_glr_example_map_001.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_example_map_002.png :alt: example map :srcset: /gallery/images/sphx_glr_example_map_002.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_example_map_003.png :alt: example map :srcset: /gallery/images/sphx_glr_example_map_003.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_example_map_004.png :alt: example map :srcset: /gallery/images/sphx_glr_example_map_004.png :class: sphx-glr-multi-img * .. image-sg:: /gallery/images/sphx_glr_example_map_005.png :alt: example map :srcset: /gallery/images/sphx_glr_example_map_005.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none coarse LSCALE low LSCALE intermediate LSCALE high LSCALE auto LSCALE | .. code-block:: Python import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature for lscale in ['coarse', 'low', 'intermediate', 'high', 'auto']: fig = plt.figure() sp = ccrs.Stereographic(central_longitude=0, central_latitude=60) ax = fig.add_subplot(1, 1, 1, projection=sp) corners = [-30, 30, 45, 75] #s = cfeature.AdaptiveScaler('coarse', # (('low', 100), ('intermediate', 20), ('high', 5), ('full', 1))) #lscale = s.scale_from_extent([corners[0], corners[1], corners[2], corners[3]]) #lscale = 'auto' print(lscale, 'LSCALE ') f = cfeature.GSHHSFeature(scale=lscale, levels=[1]) ax.add_geometries( #f.intersecting_geometries(corners), f.geometries(), ccrs.PlateCarree(), facecolor=cfeature.COLORS['land'], edgecolor='black') ax.set_extent(corners, crs=ccrs.PlateCarree()) gl = ax.gridlines(ccrs.PlateCarree()) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (1 minutes 27.678 seconds) .. _sphx_glr_download_gallery_example_map.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_map.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_map.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_