def _GoodTicks(max_value, tick_size=2.5, num_ticks=10.0):
  try_tick = tick_size
  while try_tick < max_value:
    if (max_value / try_tick) > num_ticks:
      try_tick *= 2
    else:
      return int(round(try_tick))
  # Fallback
  print "Could not find good tick size for %s (size=%s, num=%s)" % (max_value, tick_size, num_ticks)
  simple_value = int(max_value  / num_ticks)
  if simple_value > 0:
    return simple_value
  else:
    return 1
Find a good round tick size to use in graphs.
dataset/ETHPy150Open catap/namebench/libnamebench/charts.py/_GoodTicks