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

.. only:: html

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

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

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

.. _sphx_glr_examples_shading_plot_hillshade_directions.py:


Multidirectional hillshade
==========================

Plot shaded relief map using a single and multiple illumination angles.

.. GENERATED FROM PYTHON SOURCE LINES 11-43



.. image-sg:: /examples/shading/images/sphx_glr_plot_hillshade_directions_001.png
   :alt: One direction, Three directions (default), Six directions
   :srcset: /examples/shading/images/sphx_glr_plot_hillshade_directions_001.png
   :class: sphx-glr-single-img





.. code-block:: Python


    import matplotlib.pyplot as plt
    import hyoga

    # initialize figure
    fig, axes = plt.subplots(ncols=3)

    # open demo data with refined topography
    with hyoga.open.example('pism.alps.vis.refined.nc') as ds:
        ds = ds.sel(x=slice(400e3, 435e3))

        # plot bedrock altitude
        for ax in axes:
            ds.hyoga.plot.bedrock_altitude(ax=ax, cmap='Topographic', vmin=0)

        # add hillshades
        ds.hyoga.plot.bedrock_hillshade(
            ax=axes[0], altitude=45, azimuth=315)
        ds.hyoga.plot.bedrock_hillshade(
            ax=axes[1], altitude=45, azimuth=[255, 315, 15],
            weight=[0.25, 0.5, 0.25])
        ds.hyoga.plot.bedrock_hillshade(
            ax=axes[2], altitude=45, azimuth=[15, 75, 135, 195, 255, 315],
            weight=[0.2, 0.125, 0.1, 0.125, 0.2, 0.25])

    # set titles
    axes[0].set_title('One direction')
    axes[1].set_title('Three directions (default)')
    axes[2].set_title('Six directions')

    # show
    plt.show()


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

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


.. _sphx_glr_download_examples_shading_plot_hillshade_directions.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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