used plt.subplots everywhere

This commit is contained in:
Siva Prasad Varma
2014-03-14 17:37:14 +05:30
parent c60d15f2f4
commit fb72fb04b2
22 changed files with 350 additions and 405 deletions
+8 -10
View File
@@ -47,19 +47,17 @@ image[circle2] = 0
skeleton = skeletonize(image)
# display results
plt.figure(figsize=(8, 4.5))
f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4.5))
plt.subplot(121)
plt.imshow(image, cmap=plt.cm.gray)
plt.axis('off')
plt.title('original', fontsize=20)
ax1.imshow(image, cmap=plt.cm.gray)
ax1.axis('off')
ax1.set_title('original', fontsize=20)
plt.subplot(122)
plt.imshow(skeleton, cmap=plt.cm.gray)
plt.axis('off')
plt.title('skeleton', fontsize=20)
ax2.imshow(skeleton, cmap=plt.cm.gray)
ax2.axis('off')
ax2.set_title('skeleton', fontsize=20)
plt.subplots_adjust(wspace=0.02, hspace=0.02, top=0.98,
f.subplots_adjust(wspace=0.02, hspace=0.02, top=0.98,
bottom=0.02, left=0.02, right=0.98)
plt.show()