def _setup_vmin_vmax(data, vmin, vmax, norm=False):
 if ((vmax is None) and (vmin is None)):
  vmax = np.abs(data).max()
  if norm:
   vmin = 0.0
  else:
   vmin = (- vmax)
 else:
  if callable(vmin):
   vmin = vmin(data)
  elif (vmin is None):
   if norm:
    vmin = 0.0
   else:
    vmin = np.min(data)
  if callable(vmax):
   vmax = vmax(data)
  elif (vmax is None):
   vmax = np.max(data)
 return (vmin, vmax)

def _setup_vmin_vmax ( data , vmin , vmax , norm = False ) : if ( ( vmax is None ) and ( vmin is None ) ) : vmax = np . abs ( data ) . max ( ) if norm : vmin = 0.0 else : vmin = ( - vmax ) else : if callable ( vmin ) : vmin = vmin ( data ) elif ( vmin is None ) : if norm : vmin = 0.0 else : vmin = np . min ( data ) if callable ( vmax ) : vmax = vmax ( data ) elif ( vmax is None ) : vmax = np . max ( data ) return ( vmin , vmax )
aux function to handle vmin and vmax parameters .