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

.. only:: html

    .. meta::
        :keywords: codex

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

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

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

.. _sphx_glr_gallery_axes_grid1_demo_imagegrid_aspect.py:


=========================================
ImageGrid cells with a fixed aspect ratio
=========================================

.. GENERATED FROM PYTHON SOURCE LINES 6-24

.. code-block:: Python


    import matplotlib.pyplot as plt

    from mpl_toolkits.axes_grid1 import ImageGrid

    fig = plt.figure()

    grid1 = ImageGrid(fig, 121, (2, 2), axes_pad=0.1,
                      aspect=True, share_all=True)
    for i in [0, 1]:
        grid1[i].set_aspect(2)

    grid2 = ImageGrid(fig, 122, (2, 2), axes_pad=0.1,
                      aspect=True, share_all=True)
    for i in [1, 3]:
        grid2[i].set_aspect(2)

    plt.show()


.. _sphx_glr_download_gallery_axes_grid1_demo_imagegrid_aspect.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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