def _try_all(image, methods=None, figsize=None, num_cols=2, verbose=True):
 from matplotlib import pyplot as plt
 num_rows = math.ceil(((len(methods) + 1.0) / num_cols))
 num_rows = int(num_rows)
 (fig, ax) = plt.subplots(num_rows, num_cols, figsize=figsize, sharex=True, sharey=True, subplot_kw={'adjustable': 'box-forced'})
 ax = ax.ravel()
 ax[0].imshow(image, cmap=plt.cm.gray)
 ax[0].set_title('Original')
 i = 1
 for (name, func) in methods.items():
  ax[i].imshow(func(image), cmap=plt.cm.gray)
  ax[i].set_title(name)
  i += 1
  if verbose:
   print func.__orifunc__
 for a in ax:
  a.axis('off')
 fig.tight_layout()
 return (fig, ax)

def _try_all ( image , methods = None , figsize = None , num_cols = 2 , verbose = True ) : from matplotlib import pyplot as plt num_rows = math . ceil ( ( ( len ( methods ) + 1.0 ) / num_cols ) ) num_rows = int ( num_rows ) ( fig , ax ) = plt . subplots ( num_rows , num_cols , figsize = figsize , sharex = True , sharey = True , subplot_kw = { 'adjustable' : 'box-forced' } ) ax = ax . ravel ( ) ax [ 0 ] . imshow ( image , cmap = plt . cm . gray ) ax [ 0 ] . set_title ( 'Original' ) i = 1 for ( name , func ) in methods . items ( ) : ax [ i ] . imshow ( func ( image ) , cmap = plt . cm . gray ) ax [ i ] . set_title ( name ) i += 1 if verbose : print func . __orifunc__ for a in ax : a . axis ( 'off' ) fig . tight_layout ( ) return ( fig , ax )
returns a figure comparing the outputs of different methods .