.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_size_distribution.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_size_distribution.py: Example Size Distribution Plots ------------------------------- Example shows how to plot up CCN droplet count in a size distribution plot. Also shows how to add different plot types together using assign_to_figure_axis. Author: Adam Theisen .. GENERATED FROM PYTHON SOURCE LINES 13-39 .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_size_distribution_001.png :alt: sgpaosccn2colaE13.b1 N_CCN_dN on 20170903 at 15:47:31, sgpaosccn2colaE13.b1 N_CCN_dN on 20170903 :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_size_distribution_001.png :class: sphx-glr-single-img .. code-block:: Python from arm_test_data import DATASETS import matplotlib.pyplot as plt import numpy as np import act # Read CCN data in from the test data area filename_ccn = DATASETS.fetch('sgpaosccn2colaE13.b1.20170903.000000.nc') ds = act.io.arm.read_arm_netcdf(filename_ccn) # Create a DistributionDisplay object display = act.plotting.DistributionDisplay(ds, subplot_shape=(2,), figsize=(12, 10)) # Create a size distribution plot while plotting the # size distribution in the second plot t_ind = np.datetime64('2017-09-03T15:47:31') display.plot_size_distribution('N_CCN_dN', 'droplet_size', time=t_ind, subplot_index=(0,)) # This part shows how you can use different display types in a single plot # by assigning the new display object to a figure and axes from the first one. display2 = act.plotting.TimeSeriesDisplay(ds) display2.assign_to_figure_axis(display.fig, display.axes[1]) display2.plot('N_CCN_dN') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.267 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_size_distribution.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_size_distribution.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_size_distribution.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_size_distribution.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_