(data, factor=10)
return (min_x, max_x, min_y, max_y)
Return bounds of data.
Return bounds of data.
Return bounds of data .
def get_bounds(data, factor=10):
  """Return bounds of data."""
  min_x = 0
  max_x = 0
  min_y = 0
  max_y = 0

  abs_x = 0
  abs_y = 0
  for i in range(len(data)):
    x = float(data[i, 0]) / factor
    y = float(data[i, 1]) / factor
    abs_x += x
    abs_y += y
    min_x = min(min_x, abs_x)
    min_y = min(min_y, abs_y)
    max_x = max(max_x, abs_x)
    max_y = max(max_y, abs_y)

  return (min_x, max_x, min_y, max_y)
def get_bounds ( data , factor = 10 ) : min_x = 0 max_x = 0 min_y = 0 max_y = 0 abs_x = 0 abs_y = 0 for i in range ( len ( data ) ) : x = float ( data [ i , 0 ] ) / factor y = float ( data [ i , 1 ] ) / factor abs_x += x abs_y += y min_x = min ( min_x , abs_x ) min_y = min ( min_y , abs_y ) max_x = max ( max_x , abs_x ) max_y = max ( max_y , abs_y ) return ( min_x , max_x , min_y , max_y )