.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_contour.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_source_auto_examples_plotting_plot_contour.py: Spatial contour plot -------------------- This is an example of how to prepare and plot data for a contour plot Author: Adam Theisen .. GENERATED FROM PYTHON SOURCE LINES 11-64 .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_contour_001.png :alt: plot contour :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_contour_001.png :class: sphx-glr-single-img .. code-block:: Python from arm_test_data import DATASETS import matplotlib.pyplot as plt import act met_contour_list = [ 'sgpmetE15.b1.20190508.000000.cdf', 'sgpmetE31.b1.20190508.000000.cdf', 'sgpmetE32.b1.20190508.000000.cdf', 'sgpmetE33.b1.20190508.000000.cdf', 'sgpmetE34.b1.20190508.000000.cdf', 'sgpmetE35.b1.20190508.000000.cdf', 'sgpmetE36.b1.20190508.000000.cdf', 'sgpmetE37.b1.20190508.000000.cdf', 'sgpmetE38.b1.20190508.000000.cdf', 'sgpmetE39.b1.20190508.000000.cdf', 'sgpmetE40.b1.20190508.000000.cdf', 'sgpmetE9.b1.20190508.000000.cdf', 'sgpmetE13.b1.20190508.000000.cdf', ] met_contour_filenames = [DATASETS.fetch(file) for file in met_contour_list] time = '2019-05-08T04:00:00.000000000' data = {} fields = {} wind_fields = {} station_fields = {} for f in met_contour_filenames: ds = act.io.arm.read_arm_netcdf(f) data.update({f: ds}) fields.update({f: ['lon', 'lat', 'temp_mean']}) wind_fields.update({f: ['lon', 'lat', 'wspd_vec_mean', 'wdir_vec_mean']}) station_fields.update( { f: [ 'lon', 'lat', 'temp_mean', 'atmos_pressure', 'vapor_pressure_mean', 'rh_mean', ] } ) display = act.plotting.ContourDisplay(data, figsize=(8, 8)) display.create_contour(fields=fields, time=time, levels=50) display.plot_vectors_from_spd_dir(fields=wind_fields, time=time, mesh=True, grid_delta=(0.1, 0.1)) display.plot_station(fields=station_fields, time=time, markersize=7, color='red') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.841 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_contour.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_contour.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_contour.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_contour.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_