adding axes sharing to displays of related images

for better interaction

sharing achieved by setting sharex and sharey, and
setting the axes 'adjustable' parameter to 'box-forced'
This commit is contained in:
martin
2015-10-12 15:58:57 +02:00
parent 8ff6d2d8e3
commit 9fa9c0387c
24 changed files with 105 additions and 54 deletions
+13 -1
View File
@@ -100,7 +100,19 @@ for theta in (0, 1):
# Save kernel and the power image for each image
results.append((kernel, [power(img, kernel) for img in images]))
fig, axes = plt.subplots(nrows=5, ncols=4, figsize=(5, 6))
# Prepare exes for ploting
fig = plt.figure(figsize=(5, 6))
axes = np.zeros((5, 4), dtype=np.object)
# first column
for n in range(0, 5):
axes[n,0] = plt.subplot(5, 4, 1+n*4)
# the other columns, each column axes are shared
for m in range(1, 4):
axes[0,m] = plt.subplot(5, 4, 1+m, adjustable='box-forced')
for n in range(1, 5):
axes[n,m] = plt.subplot(5, 4, 1+n*4+m, sharex=axes[0,m], sharey=axes[0,m])
axes[n,m].set_adjustable('box-forced')
plt.gray()
fig.suptitle('Image responses for Gabor filter kernels', fontsize=12)