You are reading an old version of the documentation (v1.5.0). For the latest version see https://matplotlib.org/stable/

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

axes_grid example code: demo_floating_axis.py

Next topic

axes_grid example code: demo_parasite_axes2.py

This Page

axes_grid example code: demo_imagegrid_aspect.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/demo_imagegrid_aspect.png
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()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)