mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-02 15:06:06 +08:00
used plt.subplots everywhere
This commit is contained in:
@@ -58,20 +58,17 @@ markers[data > 1.3] = 2
|
||||
labels = random_walker(data, markers, beta=10, mode='bf')
|
||||
|
||||
# Plot results
|
||||
plt.figure(figsize=(8, 3.2))
|
||||
plt.subplot(131)
|
||||
plt.imshow(data, cmap='gray', interpolation='nearest')
|
||||
plt.axis('off')
|
||||
plt.title('Noisy data')
|
||||
plt.subplot(132)
|
||||
plt.imshow(markers, cmap='hot', interpolation='nearest')
|
||||
plt.axis('off')
|
||||
plt.title('Markers')
|
||||
plt.subplot(133)
|
||||
plt.imshow(labels, cmap='gray', interpolation='nearest')
|
||||
plt.axis('off')
|
||||
plt.title('Segmentation')
|
||||
f, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(8, 3.2))
|
||||
ax1.imshow(data, cmap='gray', interpolation='nearest')
|
||||
ax1.axis('off')
|
||||
ax1.set_title('Noisy data')
|
||||
ax2.imshow(markers, cmap='hot', interpolation='nearest')
|
||||
ax2.axis('off')
|
||||
ax2.set_title('Markers')
|
||||
ax3.imshow(labels, cmap='gray', interpolation='nearest')
|
||||
ax3.axis('off')
|
||||
ax3.set_title('Segmentation')
|
||||
|
||||
plt.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0,
|
||||
f.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0,
|
||||
right=1)
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user