.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/geo/02_orthographic_views.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_02_orthographic_views.py: Orthographic comparison ======================= Two orthographic views of the same signal to emphasize projection control. Why UltraPlot here? ------------------- UltraPlot handles multiple projections in one figure with a consistent API and shared formatting calls. This makes side-by-side map comparisons simple. Key functions: :py:func:`ultraplot.figure.Figure.subplot`, :py:meth:`ultraplot.axes.GeoAxes.format`. See also -------- * :doc:`Geographic projections ` .. GENERATED FROM PYTHON SOURCE LINES 18-47 .. image-sg:: /gallery/geo/images/sphx_glr_02_orthographic_views_001.png :alt: Orthographic views of a global track, Western Hemisphere, Eastern Hemisphere :srcset: /gallery/geo/images/sphx_glr_02_orthographic_views_001.png :class: sphx-glr-single-img .. code-block:: Python import cartopy.crs as ccrs import numpy as np import ultraplot as uplt lon = np.linspace(-180, 180, 220) lat = 20 * np.sin(np.deg2rad(lon * 2.2)) fig = uplt.figure(refwidth=3, share=0) ax1 = fig.subplot(121, proj="ortho", proj_kw={"lon0": -100, "lat0": 35}) ax2 = fig.subplot(122, proj="ortho", proj_kw={"lon0": 80, "lat0": -15}) for ax, title in zip([ax1, ax2], ["Western Hemisphere", "Eastern Hemisphere"]): ax.plot(lon, lat, transform=ccrs.PlateCarree(), lw=2, color="cherry red") ax.scatter(lon[::40], lat[::40], transform=ccrs.PlateCarree(), s=30) ax.format( lonlines=60, latlines=30, title=title, land=True, ocean=True, oceancolor="ocean blue", landcolor="mushroom", ) fig.format(suptitle="Orthographic views of a global track") fig.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.740 seconds) .. _sphx_glr_download_gallery_geo_02_orthographic_views.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 02_orthographic_views.ipynb <02_orthographic_views.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 02_orthographic_views.py <02_orthographic_views.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 02_orthographic_views.zip <02_orthographic_views.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_