docs: def calc_max_min(ss):
      """"Calculates (x, y) (max, min) for a list of Spectrum objects.
  
      Returns (xmin, xmax, ymin, ymax, xspan, yspan)
      """
      xmin, xmax, ymin, ymax = 1e38, -1e38, 1e38, -1e38
      for s in ss:
          assert isinstance(s, ft.Spectrum)
          if len(s.x) > 0:
              xmin, xmax = min(min(s.x), xmin), max(max(s.x), xmax)
              ymin, ymax = min(min(s.y), ymin), max(max(s.y), ymax)
      xspan = xmax-xmin
      yspan = ymax - ymin
      return xmin, xmax, ymin, ymax, xspan, yspan