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

.. only:: html

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

        Click :ref:`here <sphx_glr_download_source_auto_examples_xsection_example.py>`
        to download the full example code

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

.. _sphx_glr_source_auto_examples_xsection_example.py:


Example for plotting multidimensional cross sections
====================================================

In this example, the VISST

.. GENERATED FROM PYTHON SOURCE LINES 7-38

.. code-block:: default


    import act
    import matplotlib.pyplot as plt
    import xarray as xr

    from datetime import datetime
    my_ds = act.io.armfiles.read_netcdf('twpvisst*')

    # Cross section display requires that the variable being plotted be reduced to two
    # Dimensions whose coordinates can be specified by variables in the file
    print(my_ds)
    disp = act.plotting.XSectionDisplay(my_ds, subplot_shape=(2, 2))
    disp.plot_xsection_map(None, 'ir_temperature', x='longitude', y='latitude',
                           sel_kwargs={'time': datetime(2005, 7, 5, 1, 45, 00)},
                           isel_kwargs={'scn_type': 0},
                           cmap='Greys', vmin=200, vmax=320, subplot_index=(0, 0))
    disp.plot_xsection_map(None, 'ir_temperature', x='longitude', y='latitude',
                           sel_kwargs={'time': datetime(2005, 7, 5, 2, 45, 00)},
                           isel_kwargs={'scn_type': 0},
                           cmap='Greys', vmin=200, vmax=320, subplot_index=(1, 0))
    disp.plot_xsection_map(None, 'ir_temperature', x='longitude', y='latitude',
                           sel_kwargs={'time': datetime(2005, 7, 5, 3, 25, 00)},
                           isel_kwargs={'scn_type': 0},
                           cmap='Greys', vmin=200, vmax=320, subplot_index=(0, 1))
    disp.plot_xsection_map(None, 'ir_temperature', x='longitude', y='latitude',
                           sel_kwargs={'time': datetime(2005, 7, 5, 3, 55, 00)},
                           isel_kwargs={'scn_type': 0},
                           cmap='Greys', vmin=200, vmax=320, subplot_index=(1, 1))

    plt.show()
    my_ds.close()


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

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


.. _sphx_glr_download_source_auto_examples_xsection_example.py:


.. only :: html

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



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

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



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

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


.. only:: html

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

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