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

    Click :ref:`here <sphx_glr_download_source_auto_examples_plot_wind_rose.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_source_auto_examples_plot_wind_rose.py:


=====================================================================
Example on how to plot winds and relative humidity from sounding data
=====================================================================

This is an example of how to display wind rose and barb timeseries
from multiple days worth of sounding data.



.. image:: /source/auto_examples/images/sphx_glr_plot_wind_rose_001.png
    :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none

    /Users/atheisen/Code/ACT/examples/plot_wind_rose.py:34: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
      plt.show()





|


.. code-block:: default


    import act
    import numpy as np

    from matplotlib import pyplot as plt

    sonde_ds = act.io.armfiles.read_netcdf(
        act.tests.sample_files.EXAMPLE_TWP_SONDE_WILDCARD)

    WindDisplay = act.plotting.WindRoseDisplay(sonde_ds, figsize=(8, 10), subplot_shape=(2,))
    WindDisplay.plot('deg', 'wspd',
                     spd_bins=np.linspace(0, 25, 5), num_dirs=30,
                     tick_interval=2, subplot_index=(0,))


    BarbDisplay = act.plotting.TimeSeriesDisplay(
        {'sonde_darwin': sonde_ds}, figsize=(10, 5))
    WindDisplay.put_display_in_subplot(BarbDisplay, subplot_index=(1,))
    BarbDisplay.plot_time_height_xsection_from_1d_data('rh', 'pres',
                                                       cmap='coolwarm_r',
                                                       vmin=0, vmax=100,
                                                       num_time_periods=25)
    BarbDisplay.plot_barbs_from_spd_dir('deg', 'wspd', 'pres',
                                        num_barbs_x=20)
    plt.show()


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

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


.. _sphx_glr_download_source_auto_examples_plot_wind_rose.py:


.. only :: html

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



  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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