def plot_really_bad_images(images):
 really_bad_image_indices = [324, 582, 659, 726, 846, 956, 1124, 1393, 1773, 1868, 2018, 2109, 2654, 4199, 4201, 4620, 5457, 5642]
 n = len(really_bad_image_indices)
 really_bad_images = [images[j] for j in really_bad_image_indices]
 fig = plt.figure(figsize=(10, 2))
 for j in xrange(1, (n + 1)):
  ax = fig.add_subplot(2, 9, j)
  ax.matshow(really_bad_images[(j - 1)], cmap=matplotlib.cm.binary)
  plt.xticks(np.array([]))
  plt.yticks(np.array([]))
 plt.show()

def plot_really_bad_images ( images ) : really_bad_image_indices = [ 324 , 582 , 659 , 726 , 846 , 956 , 1124 , 1393 , 1773 , 1868 , 2018 , 2109 , 2654 , 4199 , 4201 , 4620 , 5457 , 5642 ] n = len ( really_bad_image_indices ) really_bad_images = [ images [ j ] for j in really_bad_image_indices ] fig = plt . figure ( figsize = ( 10 , 2 ) ) for j in xrange ( 1 , ( n + 1 ) ) : ax = fig . add_subplot ( 2 , 9 , j ) ax . matshow ( really_bad_images [ ( j - 1 ) ] , cmap = matplotlib . cm . binary ) plt . xticks ( np . array ( [ ] ) ) plt . yticks ( np . array ( [ ] ) ) plt . show ( )
this takes a list of the worst images from plot_bad_images and turns them into a figure .