def rescale_layout(pos, scale=1):
 lim = 0
 for i in range(pos.shape[1]):
  pos[:, i] -= pos[:, i].mean()
  lim = max(pos[:, i].max(), lim)
 if (lim > 0):
  for i in range(pos.shape[1]):
   pos[:, i] *= (scale / lim)
 return pos

def rescale_layout ( pos , scale = 1 ) : lim = 0 for i in range ( pos . shape [ 1 ] ) : pos [ : , i ] -= pos [ : , i ] . mean ( ) lim = max ( pos [ : , i ] . max ( ) , lim ) if ( lim > 0 ) : for i in range ( pos . shape [ 1 ] ) : pos [ : , i ] *= ( scale / lim ) return pos
return scaled position array to in all axes .