.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/general/plot_global_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_generated_gallery_general_plot_global_map.py: Quickplot of a 2D Cube on a Map =============================== This example demonstrates a contour plot of global air temperature. The plot title and the labels for the axes are automatically derived from the metadata. .. GENERATED FROM PYTHON SOURCE LINES 9-38 .. image-sg:: /generated/gallery/general/images/sphx_glr_plot_global_map_001.png :alt: Air temperature, Air temperature :srcset: /generated/gallery/general/images/sphx_glr_plot_global_map_001.png :class: sphx-glr-single-img .. code-block:: Python import cartopy.crs as ccrs import matplotlib.pyplot as plt import iris import iris.plot as iplt import iris.quickplot as qplt def main(): fname = iris.sample_data_path("air_temp.pp") temperature = iris.load_cube(fname) # Plot #1: contourf with axes longitude from -180 to 180 plt.figure(figsize=(12, 5)) plt.subplot(121) qplt.contourf(temperature, 15) plt.gca().coastlines() # Plot #2: contourf with axes longitude from 0 to 360 proj = ccrs.PlateCarree(central_longitude=-180.0) plt.subplot(122, projection=proj) qplt.contourf(temperature, 15) plt.gca().coastlines() iplt.show() if __name__ == "__main__": main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.292 seconds) .. _sphx_glr_download_generated_gallery_general_plot_global_map.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_global_map.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_global_map.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_