original_docstring: Sets the current maximum value, possibly including room for a plot
          header. Adjusts accordinly if logY is set
  
          Args:
              value: The value to set
          
docstring: Sets the current maximum value, possibly including room for a plot
  header. Adjusts accordinly if logY is set
docstring_tokens: Sets the current maximum value possibly including room for a plot header . Adjusts accordinly if logY is set
code: def _set_maximum_value(self, value):
          """Sets the current maximum value, possibly including room for a plot
          header. Adjusts accordinly if logY is set
  
          Args:
              value: The value to set
          """
          # Check if the current value is not None, and if so, throw an error
          # because this property should not be set twice
          if self._get_maximum_value() is not None:
              raise RuntimeError('maximum value should not be set twice')
  
          # If the value is None, ignore it
          if value is None:
              return
  
          # If the user wants a plot header, then add space for one
          if self._plot_header:
  
              if self._logy:
                  # ensure y-axis is scaled by 30% for log-plot
                  try:
                      nDecades = (log10(value) - log10(self._minimum_value))
                      if True:
                          #print 'min decade:', log10(self._minimum_value)
                          #print 'max decade:', log10(value)
                          #print 'No. decades:', nDecades
                          pass
                      # increase the number of decades by 30 % 
                      nDecades *= 1.3 
                      value = self._minimum_value * 10**nDecades
                      #print 'new max decade', log10(value)
                  except ValueError:
                      value *= 10**3 # of min value is 0, default to an extra 3 decades
  
              else:
                  # Grab the plot pad height (in pixels)
                  plot_height = (
                      self.PLOT_HEIGHT * (self._plot.GetY2() - self._plot.GetY1())
                  )
                  
                  # Adjust the height
                  value *= (plot_height + self.PLOT_HEADER_HEIGHT) / plot_height
                  value *= 1.1
              
  
          # Set the value
          self._maximum_value = value
code_tokens: def _set_maximum_value ( self , value ) : if self . _get_maximum_value ( ) is not None : raise RuntimeError ( 'maximum value should not be set twice' ) if value is None : return if self . _plot_header : if self . _logy : try : nDecades = ( log10 ( value ) - log10 ( self . _minimum_value ) ) if True : pass nDecades *= 1.3 value = self . _minimum_value * 10 ** nDecades except ValueError : value *= 10 ** 3 else : plot_height = ( self . PLOT_HEIGHT * ( self . _plot . GetY2 ( ) - self . _plot . GetY1 ( ) ) ) value *= ( plot_height + self . PLOT_HEADER_HEIGHT ) / plot_height value *= 1.1 self . _maximum_value = value
short_docstring: Sets the current maximum value, possibly including room for a plot
  header.
short_docstring_tokens: Sets the current maximum value possibly including room for a plot header .
comment: """Sets the current maximum value, possibly including room for a plot
          header. Adjusts accordinly if logY is set
  
          Args:
              value: The value to set
          """$SEP$# Check if the current value is not None, and if so, throw an error$SEP$# because this property should not be set twice$SEP$# If the value is None, ignore it$SEP$# If the user wants a plot header, then add space for one$SEP$# ensure y-axis is scaled by 30% for log-plot$SEP$#print 'min decade:', log10(self._minimum_value)$SEP$#print 'max decade:', log10(value)$SEP$#print 'No. decades:', nDecades$SEP$# increase the number of decades by 30 % $SEP$#print 'new max decade', log10(value)$SEP$# of min value is 0, default to an extra 3 decades$SEP$# Grab the plot pad height (in pixels)$SEP$# Adjust the height$SEP$# Set the value