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

.. only:: html

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

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

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

.. _sphx_glr_examples_vectors_plot_scale_bar.py:


Scale bars
==========

Plot scale bars with different styles.

.. GENERATED FROM PYTHON SOURCE LINES 11-39



.. image-sg:: /examples/vectors/images/sphx_glr_plot_scale_bar_001.png
   :alt: Scale bars
   :srcset: /examples/vectors/images/sphx_glr_plot_scale_bar_001.png
   :class: sphx-glr-single-img





.. code-block:: Python


    import matplotlib.pyplot as plt
    import hyoga

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

        # plot model output
        ds.hyoga.plot.bedrock_altitude(vmin=0)

        # custom size
        ds.hyoga.plot.scale_bar(loc='upper center', size=200e3)

        # custom style
        ds.hyoga.plot.scale_bar(loc='lower left', color='tab:red', marker='o')

        # custom label
        ds.hyoga.plot.scale_bar(loc='lower center', label='hundred kilometers')

        # default scale bar
        ds.hyoga.plot.scale_bar()


    # set title
    plt.title('Scale bars')

    # show
    plt.show()


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

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


.. _sphx_glr_download_examples_vectors_plot_scale_bar.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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