.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/axes_grid1/simple_axesgrid2.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_axes_grid1_simple_axesgrid2.py: ================== Simple ImageGrid 2 ================== Align multiple images of different sizes using `~mpl_toolkits.axes_grid1.axes_grid.ImageGrid`. .. GENERATED FROM PYTHON SOURCE LINES 9-32 .. image-sg:: /gallery/axes_grid1/images/sphx_glr_simple_axesgrid2_001.png :alt: simple axesgrid2 :srcset: /gallery/axes_grid1/images/sphx_glr_simple_axesgrid2_001.png, /gallery/axes_grid1/images/sphx_glr_simple_axesgrid2_001_2_00x.png 2.00x :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from matplotlib import cbook from mpl_toolkits.axes_grid1 import ImageGrid fig = plt.figure(figsize=(5.5, 3.5)) grid = ImageGrid(fig, 111, # similar to subplot(111) nrows_ncols=(1, 3), axes_pad=0.1, label_mode="L", ) # demo image Z = cbook.get_sample_data("axes_grid/bivariate_normal.npy") im1 = Z im2 = Z[:, :10] im3 = Z[:, 10:] vmin, vmax = Z.min(), Z.max() for ax, im in zip(grid, [im1, im2, im3]): ax.imshow(im, origin="lower", vmin=vmin, vmax=vmax) plt.show() .. _sphx_glr_download_gallery_axes_grid1_simple_axesgrid2.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: simple_axesgrid2.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: simple_axesgrid2.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_