def _filter_ticks(lims, fscale):
 if (fscale == 'linear'):
  return (None, None)
 lims = np.array(lims)
 ticks = list()
 for exp in range(int(np.floor(np.log10(lims[0]))), (int(np.floor(np.log10(lims[1]))) + 1)):
  ticks += (np.array([1, 2, 4]) * (10 ** exp)).tolist()
 ticks = np.array(ticks)
 ticks = ticks[((ticks >= lims[0]) & (ticks <= lims[1]))]
 ticklabels = [(('%g' if (t < 1) else '%d') % t) for t in ticks]
 return (ticks, ticklabels)

def _filter_ticks ( lims , fscale ) : if ( fscale == 'linear' ) : return ( None , None ) lims = np . array ( lims ) ticks = list ( ) for exp in range ( int ( np . floor ( np . log10 ( lims [ 0 ] ) ) ) , ( int ( np . floor ( np . log10 ( lims [ 1 ] ) ) ) + 1 ) ) : ticks += ( np . array ( [ 1 , 2 , 4 ] ) * ( 10 ** exp ) ) . tolist ( ) ticks = np . array ( ticks ) ticks = ticks [ ( ( ticks >= lims [ 0 ] ) & ( ticks <= lims [ 1 ] ) ) ] ticklabels = [ ( ( '%g' if ( t < 1 ) else '%d' ) % t ) for t in ticks ] return ( ticks , ticklabels )
create approximately spaced ticks between lims .