.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/meteorology/plot_TEC.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_meteorology_plot_TEC.py: Ionosphere Space Weather ======================== This space weather example plots a filled contour of rotated pole point data with a shaded relief image underlay. The plot shows aggregated vertical electron content in the ionosphere. The plot exhibits an interesting outline effect due to excluding data values below a certain threshold. .. GENERATED FROM PYTHON SOURCE LINES 13-43 .. image-sg:: /generated/gallery/meteorology/images/sphx_glr_plot_TEC_001.png :alt: Total Electron Content :srcset: /generated/gallery/meteorology/images/sphx_glr_plot_TEC_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy.ma as ma import iris import iris.plot as iplt import iris.quickplot as qplt def main(): # Load the "total electron content" cube. filename = iris.sample_data_path("space_weather.nc") cube = iris.load_cube(filename, "total electron content") # Explicitly mask negative electron content. cube.data = ma.masked_less(cube.data, 0) # Plot the cube using one hundred colour levels. qplt.contourf(cube, 100) plt.title("Total Electron Content") plt.xlabel("longitude / degrees") plt.ylabel("latitude / degrees") 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.739 seconds) .. _sphx_glr_download_generated_gallery_meteorology_plot_TEC.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_TEC.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_TEC.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_