:orphan:

.. _examples-index:

Basics Gallery with Matplotlib
==============================

This page consists of the 'Basics Gallery with matplotlib' 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 'Basics Gallery with Matplotlib' 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-thumbnails">

.. thumbnail-parent-div-open

.. 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

  .. image:: /auto_examples/images/thumb/sphx_glr_local_module_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_local_module.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Local module</div>
    </div>


.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_0_sin_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_0_sin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Introductory example - Plotting sin</div>
    </div>


.. 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

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_1_exp_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_1_exp.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting the exponential function</div>
    </div>


.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_2_seaborn_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_2_seaborn.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Seaborn example</div>
    </div>


.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_3_capture_repr_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_3_capture_repr.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Capturing output representations</div>
    </div>


.. 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

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_4_choose_thumbnail_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_4_choose_thumbnail.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Choosing the thumbnail figure</div>
    </div>


.. 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

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_4b_provide_thumbnail_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_4b_provide_thumbnail.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Providing a figure for the thumbnail image</div>
    </div>


.. 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

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_5_unicode_everywhere_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_5_unicode_everywhere.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Using Unicode everywhere 🤗</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demonstrates how Sphinx-Gallery identifies when">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_6_function_identifier_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_6_function_identifier.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Identifying function names in a script</div>
    </div>


.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_7_sys_argv_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_7_sys_argv.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Using sys.argv in examples</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a Matplotlib animation, which should end up nicely embedded below.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_8_animations_thumb.gif
    :alt:

  :ref:`sphx_glr_auto_examples_plot_8_animations.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Matplotlib animation support</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/local_module
   /auto_examples/plot_0_sin
   /auto_examples/plot_1_exp
   /auto_examples/plot_2_seaborn
   /auto_examples/plot_3_capture_repr
   /auto_examples/plot_4_choose_thumbnail
   /auto_examples/plot_4b_provide_thumbnail
   /auto_examples/plot_5_unicode_everywhere
   /auto_examples/plot_6_function_identifier
   /auto_examples/plot_7_sys_argv
   /auto_examples/plot_8_animations


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-thumbnails">

.. thumbnail-parent-div-open

.. 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

  .. image:: /auto_examples/no_output/images/thumb/sphx_glr_just_code_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_no_output_just_code.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">A short Python script</div>
    </div>


.. 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

  .. image:: /auto_examples/no_output/images/thumb/sphx_glr_plot_raise_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_no_output_plot_raise.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Example that fails to execute</div>
    </div>


.. 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

  .. image:: /auto_examples/no_output/images/thumb/sphx_glr_plot_strings_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_no_output_plot_strings.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Constrained Text output frame</div>
    </div>


.. raw:: html

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

.. only:: html

  .. image:: /auto_examples/no_output/images/thumb/sphx_glr_plot_syntaxerror_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_no_output_plot_syntaxerror.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SyntaxError</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:
   :includehidden:


   /auto_examples/no_output/index.rst


.. only:: html

  .. container:: sphx-glr-footer 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>`_
