.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/geo/03_projections_features.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_geo_03_projections_features.py: Map projections and features ============================ Compare different map projections and add geographic features. Why UltraPlot here? ------------------- UltraPlot's :class:`~ultraplot.axes.GeoAxes` supports many projections via ``proj`` and makes adding features like land, ocean, and borders trivial via :meth:`~ultraplot.axes.GeoAxes.format`. Key functions: :py:func:`ultraplot.subplots`, :py:meth:`ultraplot.axes.GeoAxes.format`. See also -------- * :doc:`Geographic projections ` .. GENERATED FROM PYTHON SOURCE LINES 19-45 .. image-sg:: /gallery/geo/images/sphx_glr_03_projections_features_001.png :alt: Projections and features, Mollweide, Orthographic, Kavrayskiy VII :srcset: /gallery/geo/images/sphx_glr_03_projections_features_001.png :class: sphx-glr-single-img .. code-block:: Python import ultraplot as uplt # Projections to compare projs = ["moll", "ortho", "kav7"] fig, axs = uplt.subplots(ncols=3, proj=projs, refwidth=3, share=0) # Format all axes with features # land=True, coast=True, etc. are shortcuts for adding cartopy features axs.format( land=True, landcolor="bisque", ocean=True, oceancolor="azure", coast=True, borders=True, labels=True, suptitle="Projections and features", ) axs[0].format(title="Mollweide") axs[1].format(title="Orthographic") axs[2].format(title="Kavrayskiy VII") fig.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 7.152 seconds) .. _sphx_glr_download_gallery_geo_03_projections_features.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_projections_features.ipynb <03_projections_features.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 03_projections_features.py <03_projections_features.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 03_projections_features.zip <03_projections_features.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_