.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here ` to download the full example code
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_auto_examples_plot_equatorial_slice.py:
Plotting equatorial slices
==========================
This example shows how to plot slices in the equatorial plane from a MAS model
output.
First, load the required modules.
.. code-block:: default
from psipy.model import MASOutput
import matplotlib.pyplot as plt
Next, load a set of MAS output files. You will need to change this line to
point to a folder with MAS files in them.
.. code-block:: default
mas_path = '/Users/dstansby/github/psipy/data/helio'
model = MASOutput(mas_path)
Each MAS model contains a number of variables. The variable names can be
accessed using the ``.variables`` attribute.
.. code-block:: default
print(model.variables)
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
['p', 't', 'va', 'br', 'vp', 'jp', 'jr', 'bp', 'vr', 'bt', 'vt', 'rho', 'jt']
Set parameters for plotting. This line will give us a horizontal
errorbar underneath the plots.
.. code-block:: default
cbar_kwargs = {'orientation': 'horizontal'}
Plot the slices
.. code-block:: default
ax = plt.subplot(projection='polar')
model['vr'].plot_equatorial_cut(ax=ax, cbar_kwargs=cbar_kwargs)
plt.show()
.. image:: /auto_examples/images/sphx_glr_plot_equatorial_slice_001.png
:alt: vr, equatorial plane
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.711 seconds)
.. _sphx_glr_download_auto_examples_plot_equatorial_slice.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: plot_equatorial_slice.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_equatorial_slice.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_