Exemple #1
0
	def autoscale(self, *args):
		"""
		Autoscale the plot to the last frame.
		Set the dynamic range and reference level.
		"""
		if not len(self.samples): return
		min_level, max_level = common.get_min_max_fft(self.samples)
		#set the range to a clean number of the dynamic range
		self[Y_PER_DIV_KEY] = self.get_clean_num(1+(max_level - min_level)/self[Y_DIVS_KEY])
		#set the reference level to a multiple of y per div
		self[REF_LEVEL_KEY] = self[Y_PER_DIV_KEY]*round(.5+max_level/self[Y_PER_DIV_KEY])
 def autoscale(self, *args):
     """
     Autoscale the plot to the last frame.
     Set the dynamic range and reference level.
     """
     if not len(self.samples):
         return
     min_level, max_level = common.get_min_max_fft(self.samples)
     #set the range to a clean number of the dynamic range
     self[constants.Y_PER_DIV_KEY] = common.get_clean_num(1+(max_level - min_level)/self[constants.Y_DIVS_KEY])
     #set the reference level to a multiple of y per div
     self[constants.REF_LEVEL_KEY] = self[constants.Y_PER_DIV_KEY]*round(.5+max_level/self[constants.Y_PER_DIV_KEY])