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

.. only:: html

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

        :ref:`Go to the end <sphx_glr_download_auto_examples_plot_9_multi_image_separate.py>`
        to download the full example code. or to run this example in your browser via Binder

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

.. _sphx_glr_auto_examples_plot_9_multi_image_separate.py:


Force plots to be displayed on separate lines
=============================================
This example demonstrates how the visualisation of multiple plots produced from a single
code block can be controlled. The default behaviour is to stack plots side-by-side,
however this can be overridden to display each plot created by the code block on a
separate line, preserving their size.

There are two config options to control this behaviour:

- a file-wide ``sphinx_gallery_multi_image`` variable
- a code block-specific ``sphinx_gallery_multi_image_block`` variable

Setting these variables to ``"single"`` will force plots to be displayed on separate
lines. Default behaviour is to treat these variables as being set to ``"multi"``.

Below we demonstrate how the file-wide ``sphinx_gallery_multi_image`` variable can be
used to display plots on separate lines.

.. GENERATED FROM PYTHON SOURCE LINES 20-29

.. code-block:: Python


    # Code source: Thomas S. Binns
    # License: BSD 3 clause

    # sphinx_gallery_multi_image = "single"

    import matplotlib.pyplot as plt
    import numpy as np








.. GENERATED FROM PYTHON SOURCE LINES 30-39

.. code-block:: Python


    # Plots will be shown on separate lines

    fig, ax = plt.subplots(1, 1, figsize=(8, 4))
    ax.pcolormesh(np.random.randn(100, 100))

    fig, ax = plt.subplots(1, 1, figsize=(8, 4))
    ax.pcolormesh(np.random.randn(100, 100))




.. rst-class:: sphx-glr-horizontal


    *

      .. image-sg:: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_001.png
         :alt: plot 9 multi image separate
         :srcset: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_001.png, /auto_examples/images/sphx_glr_plot_9_multi_image_separate_001_2_00x.png 2.00x
         :class: sphx-glr-single-img

    *

      .. image-sg:: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_002.png
         :alt: plot 9 multi image separate
         :srcset: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_002.png, /auto_examples/images/sphx_glr_plot_9_multi_image_separate_002_2_00x.png 2.00x
         :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 40-43

Now, we show how the ``sphinx_gallery_multi_image_block`` variable can be used to
control the behaviour for a specific code block, here reverting to the default
behaviour of stacking plots side-by-side.

.. GENERATED FROM PYTHON SOURCE LINES 45-54

.. code-block:: Python


    # sphinx_gallery_multi_image_block = "multi"
    # ↑↑↑ Return to default behaviour for just this cell

    fig, ax = plt.subplots(1, 1, figsize=(8, 4))
    ax.pcolormesh(np.random.randn(100, 100))

    fig, ax = plt.subplots(1, 1, figsize=(8, 4))
    ax.pcolormesh(np.random.randn(100, 100))



.. rst-class:: sphx-glr-horizontal


    *

      .. image-sg:: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_003.png
         :alt: plot 9 multi image separate
         :srcset: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_003.png, /auto_examples/images/sphx_glr_plot_9_multi_image_separate_003_2_00x.png 2.00x
         :class: sphx-glr-multi-img

    *

      .. image-sg:: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_004.png
         :alt: plot 9 multi image separate
         :srcset: /auto_examples/images/sphx_glr_plot_9_multi_image_separate_004.png, /auto_examples/images/sphx_glr_plot_9_multi_image_separate_004_2_00x.png 2.00x
         :class: sphx-glr-multi-img






.. _sphx_glr_download_auto_examples_plot_9_multi_image_separate.py:

.. only:: html

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

    .. container:: binder-badge

      .. image:: images/binder_badge_logo.svg
        :target: https://mybinder.org/v2/gh/sphinx-gallery/sphinx-gallery.github.io/master?urlpath=lab/tree/notebooks/auto_examples/plot_9_multi_image_separate.ipynb
        :alt: Launch binder
        :width: 150 px

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

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

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

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

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

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


.. only:: html

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

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