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

    Click :ref:`here <sphx_glr_download_auto_examples_plot_gallery_version.py>` to download the full example code or run this example in your browser via Binder
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_plot_gallery_version.py:


Sphinx-Gallery introduction
===========================

Plot to present Sphinx-Gallery using itself to display its
version.




.. image:: /auto_examples/images/sphx_glr_plot_gallery_version_001.png
    :class: sphx-glr-single-img





.. code-block:: python


    # Code source: Óscar Nájera
    # License: BSD 3 clause

    import numpy as np
    import matplotlib.pyplot as plt
    import sphinx_gallery

    np.random.seed(32)


    def layers(n, m):
        """
        Return *n* random Gaussian mixtures, each of length *m*.
        """
        def bump(a):
            x = 1 / (.1 + np.random.random())
            y = 2 * np.random.random() - .3
            z = 13 / (.1 + np.random.random())
            for i in range(m):
                w = (i / float(m) - y) * z
                a[i] += x * np.exp(-w * w)
        a = np.zeros((m, n))
        for i in range(n):
            for j in range(12):
                bump(a[:, i])
        return np.abs(a)


    fig = plt.figure()
    d = layers(3, 100)
    x = range(100)
    for mixture in d.T:
        mixture[[0, -1]] = 0.
        plt.fill(x, mixture, alpha=0.9)

    plt.annotate('Introducing Sphinx-Gallery ' + sphinx_gallery.__version__,
                 xy=(12, 4), arrowprops=dict(arrowstyle='->'), xytext=(22, 6))

    plt.xticks([])
    plt.yticks([])


    plt.show()

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


.. _sphx_glr_download_auto_examples_plot_gallery_version.py:


.. only :: html

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


  .. container:: binder-badge

    .. image:: https://static.mybinder.org/badge.svg
      :target: https://mybinder.org/v2/gh/sphinx-gallery/sphinx-gallery.github.io/master?urlpath=lab/tree/notebooks/auto_examples/plot_gallery_version.ipynb
      :width: 150 px


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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