:orphan:



.. _sphx_glr_auto_examples:

.. _examples-index:

Gallery of Examples
===================

This page consists of the 'General example' gallery and a sub-gallery,
'No image output examples'. This sub-gallery is generated from a
sub-directory within the general examples directory. The file structure of
this gallery looks like this:

.. code-block:: none

    examples/           # base 'Gallery of Examples' directory
    ├── README.txt
    ├── <.py files>
    └── no_output/      # generates the 'No image output examples' sub-gallery
        ├── README.txt
        └── <.py files>

.. _general_examples:

General examples
----------------

This gallery consists of introductory examples and examples demonstrating
specific features of Sphinx-Gallery.


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how local modules can be imported. This module is imported in the exa...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_local_module_thumb.png
     :alt: Local module

     :ref:`sphx_glr_auto_examples_local_module.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/local_module

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is a general example demonstrating a Matplotlib plot output, embedded rST, the use of math...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_0_sin_thumb.png
     :alt: Introductory example - Plotting sin

     :ref:`sphx_glr_auto_examples_plot_0_sin.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_0_sin

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to import a local module and how images are stacked when two plot...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_1_exp_thumb.png
     :alt: Plotting the exponential function

     :ref:`sphx_glr_auto_examples_plot_1_exp.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_1_exp

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates a Seaborn plot. Figures produced Matplotlib **and** by any package th...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_2_seaborn_thumb.png
     :alt: Seaborn example

     :ref:`sphx_glr_auto_examples_plot_2_seaborn.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_2_seaborn

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how the configuration capture_repr (:ref:`capture_repr`) works. The d...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_3_capture_repr_thumb.png
     :alt: Capturing output representations

     :ref:`sphx_glr_auto_examples_plot_3_capture_repr.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_3_capture_repr

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to choose the figure that is displayed as the thumbnail, if the e...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_4_choose_thumbnail_thumb.png
     :alt: Choosing the thumbnail figure

     :ref:`sphx_glr_auto_examples_plot_4_choose_thumbnail.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_4_choose_thumbnail

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to provide a figure that is displayed as the thumbnail. This is d...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_4b_provide_thumbnail_thumb.png
     :alt: Providing a figure for the thumbnail image

     :ref:`sphx_glr_auto_examples_plot_4b_provide_thumbnail.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_4b_provide_thumbnail

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to include non-ASCII characters, mostly emoji 🎉 to stress test th...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_5_unicode_everywhere_thumb.png
     :alt: Using Unicode everywhere 🤗

     :ref:`sphx_glr_auto_examples_plot_5_unicode_everywhere.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_5_unicode_everywhere

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demonstrates how Sphinx-Gallery identifies function names to figure out which functions ar...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_6_function_identifier_thumb.png
     :alt: Identifying function names in a script

     :ref:`sphx_glr_auto_examples_plot_6_function_identifier.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_6_function_identifier

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of sys.argv in example .py files.">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_7_sys_argv_thumb.png
     :alt: Using ``sys.argv`` in examples

     :ref:`sphx_glr_auto_examples_plot_7_sys_argv.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_7_sys_argv

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sphinx-Gallery supports examples made with the `plotly library &lt;https://plotly.com/python/&gt;`_. ...">

.. only:: html

 .. figure:: /auto_examples/images/thumb/sphx_glr_plot_9_plotly_thumb.png
     :alt: Example with the plotly graphing library

     :ref:`sphx_glr_auto_examples_plot_9_plotly.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_9_plotly
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_auto_examples_no_output:

.. _no_out_examples:

No image output examples
------------------------

This section gathers examples which don't produce any figures. Some examples
only output to standard output, others demonstrate how Sphinx-Gallery handles
examples with errors.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demonstrates an example .py file that is not executed when gallery is generated (see build...">

.. only:: html

 .. figure:: /auto_examples/no_output/images/thumb/sphx_glr_just_code_thumb.png
     :alt: A short Python script

     :ref:`sphx_glr_auto_examples_no_output_just_code.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/no_output/just_code

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates a code block that raises an error and how any code blocks that follow...">

.. only:: html

 .. figure:: /auto_examples/no_output/images/thumb/sphx_glr_plot_raise_thumb.png
     :alt: Example that fails to execute

     :ref:`sphx_glr_auto_examples_no_output_plot_raise.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/no_output/plot_raise

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example captures the standard output and includes it in the example. If output is too long...">

.. only:: html

 .. figure:: /auto_examples/no_output/images/thumb/sphx_glr_plot_strings_thumb.png
     :alt: Constrained Text output frame

     :ref:`sphx_glr_auto_examples_no_output_plot_strings.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/no_output/plot_strings

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example script with invalid Python syntax ">

.. only:: html

 .. figure:: /auto_examples/no_output/images/thumb/sphx_glr_plot_syntaxerror_thumb.png
     :alt: SyntaxError

     :ref:`sphx_glr_auto_examples_no_output_plot_syntaxerror.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/no_output/plot_syntaxerror
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. only :: html

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


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

    :download:`Download all examples in Python source code: auto_examples_python.zip </auto_examples/auto_examples_python.zip>`



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

    :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip </auto_examples/auto_examples_jupyter.zip>`


.. only:: html

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

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