.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/map_plots/map_gridded_global.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_examples_map_plots_map_gridded_global.py: Global gridded (PlateCarree) with coastlines ============================================ A simple global pcolormesh with a per-axes colorbar. .. GENERATED FROM PYTHON SOURCE LINES 7-34 .. image-sg:: /examples/map_plots/images/sphx_glr_map_gridded_global_001.png :alt: Global gridded field (PlateCarree) :srcset: /examples/map_plots/images/sphx_glr_map_gridded_global_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from emcpy.plots.map_plots import MapGridded from emcpy.plots.create_plots import CreatePlot, CreateFigure # Build a lon/lat grid and a synthetic field lons = np.linspace(-180, 180, 361) lats = np.linspace(-90, 90, 181) LON, LAT = np.meshgrid(lons, lats) Z = np.sin(np.radians(LAT)) * np.cos(2 * np.radians(LON)) p = CreatePlot(projection="plcarr", domain="global") # PlateCarree + global domain mg = MapGridded(LAT, LON, Z) mg.cmap = "viridis" p.plot_layers = [mg] p.add_title("Global gridded field (PlateCarree)") p.add_map_features(["coastline", "borders"]) p.add_colorbar(label="value") p.add_grid() fig = CreateFigure(nrows=1, ncols=1, figsize=(9, 4.5)) fig.plot_list = [p] fig.create_figure() fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.138 seconds) .. _sphx_glr_download_examples_map_plots_map_gridded_global.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: map_gridded_global.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: map_gridded_global.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: map_gridded_global.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_