def _prepare_trellis(n_cells, max_col):
 import matplotlib.pyplot as plt
 if (n_cells == 1):
  nrow = ncol = 1
 elif (n_cells <= max_col):
  (nrow, ncol) = (1, n_cells)
 else:
  (nrow, ncol) = (int(math.ceil((n_cells / float(max_col)))), max_col)
 (fig, axes) = plt.subplots(nrow, ncol, figsize=(7.4, ((1.5 * nrow) + 1)))
 axes = ([axes] if (ncol == nrow == 1) else axes.flatten())
 for ax in axes[n_cells:]:
  from .topomap import _hide_frame
  _hide_frame(ax)
 return (fig, axes)

def _prepare_trellis ( n_cells , max_col ) : import matplotlib . pyplot as plt if ( n_cells == 1 ) : nrow = ncol = 1 elif ( n_cells <= max_col ) : ( nrow , ncol ) = ( 1 , n_cells ) else : ( nrow , ncol ) = ( int ( math . ceil ( ( n_cells / float ( max_col ) ) ) ) , max_col ) ( fig , axes ) = plt . subplots ( nrow , ncol , figsize = ( 7.4 , ( ( 1.5 * nrow ) + 1 ) ) ) axes = ( [ axes ] if ( ncol == nrow == 1 ) else axes . flatten ( ) ) for ax in axes [ n_cells : ] : from . topomap import _hide_frame _hide_frame ( ax ) return ( fig , axes )
aux function .