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

.. only:: html

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

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

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

.. _sphx_glr_gallery_thumbnail.py:


Choosing the thumbnail of an example
====================================

An example that draws more than once has to say which figure represents it in
the gallery grid. Setting ``sphinx_gallery_thumbnail_number`` as a comment
anywhere below the docstring picks a figure by the order it was drawn in; this
example picks the second one.

.. GENERATED FROM PYTHON SOURCE LINES 10-21

.. code-block:: Python


    import matplotlib.pyplot as plt
    import numpy as np

    try:
        import mplstyle_reslumen  # noqa: F401

        plt.style.use("reslumen")
    except ImportError:
        pass








.. GENERATED FROM PYTHON SOURCE LINES 22-27

.. code-block:: Python


    x = np.linspace(0, 4 * np.pi, 301)
    y1 = np.sin(x)
    y2 = np.cos(x)








.. GENERATED FROM PYTHON SOURCE LINES 28-30

Plot 1
------

.. GENERATED FROM PYTHON SOURCE LINES 30-37

.. code-block:: Python


    plt.figure()
    plt.plot(x, y1, label="sin")
    plt.plot(x, y2, label="cos")
    plt.legend()
    plt.show()




.. image-sg:: /gallery/images/sphx_glr_thumbnail_001.png
   :alt: thumbnail
   :srcset: /gallery/images/sphx_glr_thumbnail_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 38-42

Plot 2
------

The one the gallery shows.

.. GENERATED FROM PYTHON SOURCE LINES 42-50

.. code-block:: Python


    plt.figure()
    plt.plot(x, y1, label="sin")
    plt.plot(x, y2, label="cos")
    plt.legend()
    plt.xscale("log")
    plt.yscale("log")
    plt.show()



.. image-sg:: /gallery/images/sphx_glr_thumbnail_002.png
   :alt: thumbnail
   :srcset: /gallery/images/sphx_glr_thumbnail_002.png
   :class: sphx-glr-single-img






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

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


.. _sphx_glr_download_gallery_thumbnail.py:

.. only:: html

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

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

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

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

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

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

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