replaced subplots with individual subplot calls

share axes for the related images in subplost 221 and 223
This commit is contained in:
martin
2015-09-11 09:54:16 +02:00
parent bb081ebd0a
commit ada92ae75e
+7 -3
View File
@@ -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)