.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_heatmap.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_heatmap.py: Example plot using heat maps ---------------------------- Compare MET temperature and RH using a heatmap and scatter plot. Author: Adam Theisen .. GENERATED FROM PYTHON SOURCE LINES 11-45 .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_heatmap_001.png :alt: Heatmap of MET RH vs Temp, Scatter plot of MET RH vs Temp :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_heatmap_001.png :class: sphx-glr-single-img .. code-block:: Python from arm_test_data import DATASETS import matplotlib.pyplot as plt import act # Read MET data in from the test data area met_wildcard_list = [ 'sgpmetE13.b1.20190101.000000.cdf', 'sgpmetE13.b1.20190102.000000.cdf', 'sgpmetE13.b1.20190103.000000.cdf', 'sgpmetE13.b1.20190104.000000.cdf', 'sgpmetE13.b1.20190105.000000.cdf', 'sgpmetE13.b1.20190106.000000.cdf', 'sgpmetE13.b1.20190107.000000.cdf', ] met_filenames = [DATASETS.fetch(file) for file in met_wildcard_list] ds = act.io.arm.read_arm_netcdf(met_filenames) # Create a DistributionDisplay object to compare fields display = act.plotting.DistributionDisplay(ds, subplot_shape=(1, 2), figsize=(12, 5)) # Plot a heatmap and scatter plot up of RH vs Temperature # Set the number of bins for the x-axis to 25 and y to 20 title = 'Heatmap of MET RH vs Temp' display.plot_heatmap( 'temp_mean', 'rh_mean', x_bins=25, y_bins=20, threshold=0, subplot_index=(0, 0), set_title=title ) # Plot the scatter plot and shade by wind_speed title = 'Scatter plot of MET RH vs Temp' display.plot_scatter('temp_mean', 'rh_mean', subplot_index=(0, 1), set_title=title, m_field='time') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.647 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_heatmap.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_heatmap.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_heatmap.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_heatmap.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_