code: def scale_axes_from_data(self):
          
          # get tight limits for X-axis
          if self.args.xmin is None:
              self.args.xmin = min(fs.xspan[0] for fs in self.spectra)
          if self.args.xmax is None:
              self.args.xmax = max(fs.xspan[1] for fs in self.spectra)
  
          # autoscale view for Y-axis
          cropped = [fs.crop(self.args.xmin, self.args.xmax) for
                     fs in self.spectra]
          ymin = min(fs.value.min() for fs in cropped)
          ymax = max(fs.value.max() for fs in cropped)
          self.plot.gca().yaxis.set_data_interval(ymin, ymax, ignore=True)
          self.plot.gca().autoscale_view(scalex=False)
docs: Restrict data limits for Y-axis based on what you can see