From ada92ae75e9278a97b85a2c1fe979687bbc39fa4 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 11 Sep 2015 09:54:16 +0200 Subject: [PATCH] replaced subplots with individual subplot calls share axes for the related images in subplost 221 and 223 --- doc/examples/plot_gabors_from_astronaut.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/examples/plot_gabors_from_astronaut.py b/doc/examples/plot_gabors_from_astronaut.py index ed429203..095af98f 100644 --- a/doc/examples/plot_gabors_from_astronaut.py +++ b/doc/examples/plot_gabors_from_astronaut.py @@ -69,8 +69,12 @@ fb2 = fb2.reshape((-1,) + patch_shape) fb2_montage = montage2d(fb2, rescale_intensity=True) # -- -fig, axes = plt.subplots(2, 2, figsize=(7, 6)) -ax0, ax1, ax2, ax3 = axes.ravel() +fig = plt.figure(figsize=(7, 6)) +ax0 = plt.subplot(2, 2, 1, adjustable='box-forced') +ax1 = plt.subplot(2, 2, 2) +ax2 = plt.subplot(2, 2, 3, sharex=ax0, sharey=ax0, adjustable='box-forced') +ax3 = plt.subplot(2, 2, 4) + ax0.imshow(astro, cmap=plt.cm.gray) ax0.set_title("Image (original)") @@ -84,7 +88,7 @@ ax2.set_title("Image (LGN-like DoG)") ax3.imshow(fb2_montage, cmap=plt.cm.gray, interpolation='nearest') ax3.set_title("K-means filterbank (codebook)\non LGN-like DoG image") -for ax in axes.ravel(): +for ax in [ax0, ax1, ax2, ax3]: ax.axis('off') fig.subplots_adjust(hspace=0.3)