.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/qc/plot_force_line_qc.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_qc_plot_force_line_qc.py: Forcing line plots with 2D data and QC ----------------------------------------------------------- This is an example of how to use 2 dimentional DataArrays containing multiple 1 dimentional data, including a summary quality control plot showing the tests for each 1 dimentional data slice. This example uses the force_line_plot keyword which will force multiple 1 dimentional plots for each element along the second dimention of the non-time dimention. Author: Ken Kehoe .. GENERATED FROM PYTHON SOURCE LINES 15-49 .. image-sg:: /source/auto_examples/qc/images/sphx_glr_plot_force_line_qc_001.png :alt: nsasurfspecalb1mlawerC1.c1 surface_albedo_mfr_narrowband_10m on 20160609 :srcset: /source/auto_examples/qc/images/sphx_glr_plot_force_line_qc_001.png :class: sphx-glr-single-img .. code-block:: Python from arm_test_data import DATASETS import matplotlib.pyplot as plt from act.io.arm import read_arm_netcdf from act.plotting import TimeSeriesDisplay # Read a data file that has a 2D DataArray of multiple 1D data. # The corresponding quality control DataArray is also read in and # will be used to make a summary plot of quality control infomation # of each assessment category. filename_surf = DATASETS.fetch('nsasurfspecalb1mlawerC1.c1.20160609.080000.nc') ds = read_arm_netcdf(filename_surf) # The name of the data variable we wish to plot var_name = 'surface_albedo_mfr_narrowband_10m' # Create the ACT display object used for plotting. This will have two # vertical plots of 800 by 400 pixels. display = TimeSeriesDisplay(ds, subplot_shape=(2,), figsize=(8, 2 * 4)) # Create the top plot of data using the force_line_plot option. # This will force the plotting to not assume the data are 2D data that # would normally be plotted as a 2D plot. Rather for each index into the # filter dimention plot a 1D time series plot. Setting labels=True # will create a legend using the filter dimention DataArray. display.plot(var_name, force_line_plot=True, labels=True) # Create the bottom plot of summarized quality control by assessment # cateory. display.qc_flag_block_plot(var_name, subplot_index=(1,)) # Show the plot in a new window. plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.187 seconds) .. _sphx_glr_download_source_auto_examples_qc_plot_force_line_qc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_force_line_qc.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_force_line_qc.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_force_line_qc.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_