def plot_gallery(images, titles, h, w, n_row=3, n_col=4):
 plt.figure(figsize=((1.8 * n_col), (2.4 * n_row)))
 plt.subplots_adjust(bottom=0, left=0.01, right=0.99, top=0.9, hspace=0.35)
 for i in range((n_row * n_col)):
  plt.subplot(n_row, n_col, (i + 1))
  plt.imshow(images[i].reshape((h, w)), cmap=plt.cm.gray)
  plt.title(titles[i], size=12)
  plt.xticks(())
  plt.yticks(())

def plot_gallery ( images , titles , h , w , n_row = 3 , n_col = 4 ) : plt . figure ( figsize = ( ( 1.8 * n_col ) , ( 2.4 * n_row ) ) ) plt . subplots_adjust ( bottom = 0 , left = 0.01 , right = 0.99 , top = 0.9 , hspace = 0.35 ) for i in range ( ( n_row * n_col ) ) : plt . subplot ( n_row , n_col , ( i + 1 ) ) plt . imshow ( images [ i ] . reshape ( ( h , w ) ) , cmap = plt . cm . gray ) plt . title ( titles [ i ] , size = 12 ) plt . xticks ( ( ) ) plt . yticks ( ( ) )
helper function to plot a gallery of portraits .