
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/shading/plot_bedrock_contours.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_bedrock_contours.py>`
        to download the full example code.

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

.. _sphx_glr_examples_shading_plot_bedrock_contours.py:


Bedrock altitude contours
=========================

Plot a composite map including bedrock altitude contours, hillshade, and
geographic elements. In absence of a ``levels`` argument, the altitude levels
are internally optimized to fit the ``Topographic`` colormap.

.. GENERATED FROM PYTHON SOURCE LINES 13-38



.. image-sg:: /examples/shading/images/sphx_glr_plot_bedrock_contours_001.png
   :alt: Bedrock altitude contours
   :srcset: /examples/shading/images/sphx_glr_plot_bedrock_contours_001.png
   :class: sphx-glr-single-img


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

 .. code-block:: none

    /home/docs/checkouts/readthedocs.org/user_builds/hyoga/envs/stable/lib/python3.12/site-packages/shapely/constructive.py:829: RuntimeWarning: invalid value encountered in normalize
      return lib.normalize(geometry, **kwargs)
    /home/docs/checkouts/readthedocs.org/user_builds/hyoga/envs/stable/lib/python3.12/site-packages/shapely/constructive.py:829: RuntimeWarning: invalid value encountered in normalize
      return lib.normalize(geometry, **kwargs)
    /home/docs/checkouts/readthedocs.org/user_builds/hyoga/envs/stable/lib/python3.12/site-packages/shapely/constructive.py:829: RuntimeWarning: invalid value encountered in normalize
      return lib.normalize(geometry, **kwargs)
    /home/docs/checkouts/readthedocs.org/user_builds/hyoga/envs/stable/lib/python3.12/site-packages/shapely/constructive.py:829: RuntimeWarning: invalid value encountered in normalize
      return lib.normalize(geometry, **kwargs)






|

.. code-block:: Python


    import matplotlib.pyplot as plt
    import hyoga

    # initialize figure
    ax = plt.subplot()
    cax = plt.axes([0.15, 0.55, 0.025, 0.25])

    # open demo data
    with hyoga.open.example('pism.alps.in.boot.nc') as ds:

        # plot model output
        ds.hyoga.plot.bedrock_altitude_contours(
            ax=ax, cbar_ax=cax, cmap='Topographic', vmin=0)
        ds.hyoga.plot.bedrock_hillshade(ax=ax)

        # add coastline and rivers
        ds.hyoga.plot.natural_earth(ax=ax)

    # set axes properties
    ax.set_title('Bedrock altitude contours')
    cax.set_ylabel('')

    # show
    plt.show()


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

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


.. _sphx_glr_download_examples_shading_plot_bedrock_contours.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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