.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/general/plot_rotated_pole_mapping.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_rotated_pole_mapping.py: Rotated Pole Mapping ==================== This example uses several visualisation methods to achieve an array of differing images, including: * Visualisation of point based data * Contouring of point based data * Block plot of contiguous bounded data * Non native projection and a Natural Earth shaded relief image underlay .. GENERATED FROM PYTHON SOURCE LINES 14-66 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_001.png :alt: Air pressure at sea level :srcset: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_001.png :class: sphx-glr-multi-img * .. image-sg:: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_002.png :alt: Air pressure at sea level :srcset: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_002.png :class: sphx-glr-multi-img * .. image-sg:: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_003.png :alt: Air pressure at sea level :srcset: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_003.png :class: sphx-glr-multi-img * .. image-sg:: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_004.png :alt: plot rotated pole mapping :srcset: /generated/gallery/general/images/sphx_glr_plot_rotated_pole_mapping_004.png :class: sphx-glr-multi-img .. code-block:: Python import cartopy.crs as ccrs import matplotlib.pyplot as plt import iris import iris.analysis.cartography import iris.plot as iplt import iris.quickplot as qplt def main(): # Load some test data. fname = iris.sample_data_path("rotated_pole.nc") air_pressure = iris.load_cube(fname) # Plot #1: Point plot showing data values & a colorbar plt.figure() points = qplt.points(air_pressure, c=air_pressure.data) cb = plt.colorbar(points, orientation="horizontal") cb.set_label(air_pressure.units) plt.gca().coastlines() iplt.show() # Plot #2: Contourf of the point based data plt.figure() qplt.contourf(air_pressure, 15) plt.gca().coastlines() iplt.show() # Plot #3: Contourf overlaid by coloured point data plt.figure() qplt.contourf(air_pressure) iplt.points(air_pressure, c=air_pressure.data) plt.gca().coastlines() iplt.show() # For the purposes of this example, add some bounds to the latitude # and longitude air_pressure.coord("grid_latitude").guess_bounds() air_pressure.coord("grid_longitude").guess_bounds() # Plot #4: Block plot plt.figure() plt.axes(projection=ccrs.PlateCarree()) iplt.pcolormesh(air_pressure) plt.gca().stock_img() plt.gca().coastlines() iplt.show() if __name__ == "__main__": main() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.720 seconds) .. _sphx_glr_download_generated_gallery_general_plot_rotated_pole_mapping.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_rotated_pole_mapping.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_rotated_pole_mapping.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_