
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/plotting/plot_rhi_cfradial_singlescan.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_plotting_plot_rhi_cfradial_singlescan.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_plotting_plot_rhi_cfradial_singlescan.py:


======================================================
Create a multiple panel RHI plot from a CF/Radial file
======================================================

An example which creates a RHI plot of a CF/Radial file using
a RadarDisplay object.

.. GENERATED FROM PYTHON SOURCE LINES 10-50



.. image-sg:: /examples/plotting/images/sphx_glr_plot_rhi_cfradial_singlescan_001.png
   :alt: RHI
   :srcset: /examples/plotting/images/sphx_glr_plot_rhi_cfradial_singlescan_001.png
   :class: sphx-glr-single-img





.. code-block:: Python


    print(__doc__)

    import matplotlib.pyplot as plt

    import pyart
    from pyart.testing import get_test_data

    filename = get_test_data("sgpxsaprrhicmacI5.c0.20110524.015604_NC4.nc")

    # create the plot using RadarDisplay
    radar = pyart.io.read_cfradial(filename)
    radar.metadata["instrument_name"] = "XSARP"
    display = pyart.graph.RadarDisplay(radar)

    fig = plt.figure(figsize=[15, 5])
    fig.subplots_adjust(hspace=0.4)
    xlabel = "Distance from radar (km)"
    ylabel = "Distance above radar (km)"
    colorbar_label = "Equivalent reflectivity factor (dBZ)"
    # nplots = radar.nsweeps

    fixed_angle = radar.fixed_angle["data"][0]
    title = f"HSRHI Az={fixed_angle:.3f}"
    ax = fig.add_subplot(1, 1, 1)
    display.plot(
        "reflectivity_horizontal",
        0,
        vmin=-20,
        vmax=20,
        mask_outside=True,
        title="RHI",
        axislabels=(xlabel, ylabel),
        cmap="pyart_HomeyerRainbow",
        colorbar_label=colorbar_label,
        ax=ax,
    )
    display.set_limits(ylim=[0, 15], ax=ax)

    plt.show()


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 1.166 seconds)


.. _sphx_glr_download_examples_plotting_plot_rhi_cfradial_singlescan.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_rhi_cfradial_singlescan.ipynb <plot_rhi_cfradial_singlescan.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_rhi_cfradial_singlescan.py <plot_rhi_cfradial_singlescan.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: plot_rhi_cfradial_singlescan.zip <plot_rhi_cfradial_singlescan.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
