mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-09 08:31:43 +08:00
used plt.subplots everywhere
This commit is contained in:
@@ -90,16 +90,16 @@ image = color.rgb2gray(data.lena())
|
||||
fd, hog_image = hog(image, orientations=8, pixels_per_cell=(16, 16),
|
||||
cells_per_block=(1, 1), visualise=True)
|
||||
|
||||
plt.figure(figsize=(8, 4))
|
||||
f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4))
|
||||
|
||||
plt.subplot(121).set_axis_off()
|
||||
plt.imshow(image, cmap=plt.cm.gray)
|
||||
plt.title('Input image')
|
||||
ax1.axis('off')
|
||||
ax1.imshow(image, cmap=plt.cm.gray)
|
||||
ax1.set_title('Input image')
|
||||
|
||||
# Rescale histogram for better display
|
||||
hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 0.02))
|
||||
|
||||
plt.subplot(122).set_axis_off()
|
||||
plt.imshow(hog_image_rescaled, cmap=plt.cm.gray)
|
||||
plt.title('Histogram of Oriented Gradients')
|
||||
ax2.axis('off')
|
||||
ax2.imshow(hog_image_rescaled, cmap=plt.cm.gray)
|
||||
ax2.set_title('Histogram of Oriented Gradients')
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user