Skip to content

Instantly share code, notes, and snippets.

@dbuscombe-usgs
Created July 27, 2013 03:17
order = tree.get_cluster_elements()
slist=imlist[order]
#If i'm only interested in images of the river bend, you can see at a glance that I can remove the final cluster of 4 images, and then take the last 2 sub-clusters (comprising 10 images) so this gives me those images:
a=4
slist=slist[:len(order)-a]
a=10
slist=slist[-a:]
#Finally, I create a plot of only those final 2 clusters
mpl.figure()
for i in range(10):
im=Image.open(slist[i])
mpl.subplot(2,5,i+1)
mpl.imshow(np.array(im))
mpl.axis('equal')
mpl.axis('off')
mpl.savefig('riverbend.png')
mpl.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment