Shorten and comment show_collection example.

This commit is contained in:
Stefan van der Walt
2009-10-14 08:02:39 +02:00
parent c8bb8c6751
commit 80a366761c
+8 -9
View File
@@ -2,26 +2,25 @@ import os
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import AxesGrid
import numpy as np
from scikits.image.io import MultiImage
from scikits.image import data_dir
# Load the multi-layer image
fname = os.path.join(data_dir, 'multipage.tif')
img = MultiImage(fname)
# Create an image grid
fig = plt.figure()
grid = AxesGrid(fig, 111,
nrows_ncols = (1, 2),
axes_pad = 0.1,
add_all=True,
label_mode = "L",
aspect=True)
grid = AxesGrid(fig,
rect=(1, 1, 1),
nrows_ncols=(1, 2),
axes_pad=0.1)
# Plot the layers on the image grid
for i, frame in enumerate(img):
grid[i].imshow(frame, cmap=plt.cm.gray)
grid[i].set_xlabel('Frame %s'%i)
grid[i].set_xlabel('Frame %s' % i)
grid[i].set_xticks([])
grid[i].set_yticks([])