ImageGrid vs. make_axes_locatable(): fail?


I'm trying to make a plot of an image grid, however, I'd like to have
additional axes on top, to the left and to the right of _some_ images.

I thought that AxesGrid toolkit is exactly what I need, because
otherwise I'm having lots of trouble to force the same size and aspect
ratio of all images (e.g. with GridSpec).

Unfortunately, whereas simple ImageGrid looks great, when I start adding
axes, it breaks down and basically it looks like it's not adding new
axes to individual image axes, but to the whole ImageGrid: (left: w/o axes, right: broken state)

The reproducer is as follows:

im = np.arange(1000000)
im.shape = 1000, 1000

f = pyl.figure()

grid = ImageGrid(f, 111,
                 nrows_ncols=(2, 3),
                 axes_pad = 1,

for ax in grid:

divider = make_axes_locatable(grid[4])
cax = divider.append_axes("top", size="5%", pad=0.05)

I would greatly appreciate any advice on how to achieve what I'm looking
for with matplotlib...



Sincerely yours,
Yury V. Zaytsev