mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-11 12:43:04 +08:00
Shorten and comment show_collection example.
This commit is contained in:
@@ -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([])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user