

.. _sphx_glr_gallery_axes_grid1_demo_imagegrid_aspect.py:


=====================
Demo Imagegrid Aspect
=====================





.. image:: /gallery/axes_grid1/images/sphx_glr_demo_imagegrid_aspect_001.png
    :align: center





.. code-block:: python

    import matplotlib.pyplot as plt

    from mpl_toolkits.axes_grid1 import ImageGrid
    fig = plt.figure(1)

    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()

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



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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