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
+6 -5
View File
@@ -29,12 +29,13 @@ r = np.sin(np.exp((np.sin(x)**3 + np.cos(y)**2)))
contours = measure.find_contours(r, 0.8)
# Display the image and plot all contours found
plt.imshow(r, interpolation='nearest')
f, ax = plt.subplots()
ax.imshow(r, interpolation='nearest', cmap=plt.cm.gray)
for n, contour in enumerate(contours):
plt.plot(contour[:, 1], contour[:, 0], linewidth=2)
ax.plot(contour[:, 1], contour[:, 0], linewidth=2)
plt.axis('image')
plt.xticks([])
plt.yticks([])
ax.axis('image')
ax.set_xticks([])
ax.set_yticks([])
plt.show()