.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/geo/01_robin_tracks.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_01_robin_tracks.py: Robinson projection tracks ========================== Global tracks plotted on a Robinson projection without external datasets. Why UltraPlot here? ------------------- UltraPlot creates GeoAxes with a single ``proj`` keyword and formats geographic gridlines and features with ``format``. This avoids the verbose cartopy setup typically needed in Matplotlib. Key functions: :py:func:`ultraplot.subplots`, :py:meth:`ultraplot.axes.GeoAxes.format`. See also -------- * :doc:`Geographic projections ` .. GENERATED FROM PYTHON SOURCE LINES 19-38 .. image-sg:: /gallery/geo/images/sphx_glr_01_robin_tracks_001.png :alt: , Global trajectories :srcset: /gallery/geo/images/sphx_glr_01_robin_tracks_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, 300) lat_a = 25 * np.sin(np.deg2rad(lon * 1.5)) lat_b = -15 * np.cos(np.deg2rad(lon * 1.2)) fig, ax = uplt.subplots(proj="robin", proj_kw={"lon0": 0}, refwidth=4) ax.plot(lon, lat_a, transform=ccrs.PlateCarree(), lw=2, label="Track A") ax.plot(lon, lat_b, transform=ccrs.PlateCarree(), lw=2, label="Track B") ax.scatter([-140, -40, 60, 150], [10, -20, 30, -5], transform=ccrs.PlateCarree()) ax.format(title="Global trajectories", lonlines=60, latlines=30) ax.legend(loc="lower left", frame=False) fig.show() .. _sphx_glr_download_gallery_geo_01_robin_tracks.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01_robin_tracks.ipynb <01_robin_tracks.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01_robin_tracks.py <01_robin_tracks.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 01_robin_tracks.zip <01_robin_tracks.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_