code: def auto_display_limits(self):
          
          display_data_and_metadata = self.get_calculated_display_values(True).display_data_and_metadata
          data = display_data_and_metadata.data if display_data_and_metadata else None
          if data is not None:
              # The old algorithm was a problem during EELS where the signal data
              # is a small percentage of the overall data and was falling outside
              # the included range. This is the new simplified algorithm. Future
              # feature may allow user to select more complex algorithms.
              mn, mx = numpy.nanmin(data), numpy.nanmax(data)
              self.display_limits = mn, mx
docs: Calculate best display limits and set them.