mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 08:54:04 +08:00
Update entropy example with improved matplotlib usage
This commit is contained in:
@@ -18,16 +18,17 @@ from skimage.util import img_as_ubyte
|
||||
|
||||
image = img_as_ubyte(data.camera())
|
||||
|
||||
plt.figure(figsize=(10, 4))
|
||||
fig, (ax0, ax1) = plt.subplots(ncols=2, figsize=(10, 4))
|
||||
|
||||
plt.subplot(121)
|
||||
plt.imshow(image, cmap=plt.cm.gray)
|
||||
plt.title('Image')
|
||||
plt.colorbar()
|
||||
|
||||
plt.subplot(122)
|
||||
plt.imshow(entropy(image, disk(5)), cmap=plt.cm.jet)
|
||||
plt.title('Entropy')
|
||||
plt.colorbar()
|
||||
img0 = ax0.imshow(image, cmap=plt.cm.gray)
|
||||
ax0.set_title('Image')
|
||||
ax0.axis('off')
|
||||
plt.colorbar(img0, ax=ax0)
|
||||
|
||||
img1 = ax1.imshow(entropy(image, disk(5)), cmap=plt.cm.jet)
|
||||
ax1.set_title('Entropy')
|
||||
ax1.axis('off')
|
||||
plt.colorbar(img1, ax=ax1)
|
||||
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user