def megabytes(x, pos):
  """Formatter for Y axis, values are in megabytes"""
  if x < 1024:
      return '%d B' % (x)
  elif x < 1024 * 1024:
      return '%1.0f KiB' % (x/1024)
  else:
      return '%1.0f MiB' % (x/(1024*1024))