.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_examples.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_examples.py: Xarray Plotting Examples ------------------------ This is an example of how to use some different aspects of ACT's plotting tools as well as Xarray's tools. .. GENERATED FROM PYTHON SOURCE LINES 9-43 .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_examples_001.png :alt: sgpceilC1.b1 backscatter on 20190101, sgpceilC1.b1 backscatter on 20190101 :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_examples_001.png :class: sphx-glr-single-img .. code-block:: Python from arm_test_data import DATASETS import matplotlib.pyplot as plt import act # Set up plot space ahead of time fig, ax = plt.subplots(3, figsize=(10, 7)) # Plotting up high-temporal resolution 2D data can be very slow at times. # In order to increase the speed, the data can be resampled to a courser # resolution prior to plotting. Using Xarray's resample and selecting # the nearest neighbor will greatly increase the speed. filename_ceil = DATASETS.fetch('sgpceilC1.b1.20190101.000000.nc') ds = act.io.arm.read_arm_netcdf(filename_ceil) ds = ds.resample(time='1min').nearest() # These data can be plotted up using the existing xarray functionality # which is quick and easy ds['backscatter'].plot(x='time', ax=ax[0]) # or using ACT display = act.plotting.TimeSeriesDisplay(ds) display.assign_to_figure_axis(fig, ax[1]) display.plot('backscatter') # When using ACT, the axis object can also be manipulated using normal # matplotlib calls for more personalized customizations display = act.plotting.TimeSeriesDisplay(ds) display.assign_to_figure_axis(fig, ax[2]) display.plot('backscatter') display.axes[-1].set_ylim([0, 1500]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.422 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_examples.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_examples.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_examples.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_examples.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_