parameters: (self, base, N, format)
return_statement: return output
docstring: Return less than -N or exactly N optimal logarithmic ticks.
  
      Normally only used internally.
docstring_summary: Return less than -N or exactly N optimal logarithmic ticks.
docstring_tokens: Return less than - N or exactly N optimal logarithmic ticks .
function: def compute_logticks(self, base, N, format):
      """Return less than -N or exactly N optimal logarithmic ticks.
  
      Normally only used internally.
      """
      if self.low >= self.high: raise ValueError("low must be less than high")
      if N == 1: raise ValueError("N can be 0 or >1 to specify the exact number of ticks or negative to specify a maximum")
  
      eps = _epsilon * (self.high - self.low)
  
      if N >= 0:
        output = {}
        x = self.low
        for i in range(N):
          if format == unumber and abs(x) < eps: label = u"0"
          else: label = format(x)
          output[x] = label
          x += (self.high - self.low)/(N-1.)
        return output
  
      N = -N
  
      lowN = math.floor(math.log(self.low, base))
      highN = math.ceil(math.log(self.high, base))
      output = {}
      for n in range(int(lowN), int(highN)+1):
        x = base**n
        label = format(x)
        if self.low <= x <= self.high: output[x] = label
  
      for i in range(1, len(output)):
        keys = sorted(output.keys())
        keys = keys[::i]
        values = map(lambda k: output[k], keys)
        if len(values) <= N:
          for k in output.keys():
            if k not in keys:
              output[k] = ""
          break
  
      if len(output) <= 2:
        output2 = self.compute_ticks(N=-int(math.ceil(N/2.)), format=format)
        lowest = min(output2)
  
        for k in output:
          if k < lowest: output2[k] = output[k]
        output = output2
  
      return output
function_tokens: def compute_logticks ( self , base , N , format ) : if self . low >= self . high : raise ValueError ( "low must be less than high" ) if N == 1 : raise ValueError ( "N can be 0 or >1 to specify the exact number of ticks or negative to specify a maximum" ) eps = _epsilon * ( self . high - self . low ) if N >= 0 : output = { } x = self . low for i in range ( N ) : if format == unumber and abs ( x ) < eps : label = u"0" else : label = format ( x ) output [ x ] = label x += ( self . high - self . low ) / ( N - 1. ) return output N = - N lowN = math . floor ( math . log ( self . low , base ) ) highN = math . ceil ( math . log ( self . high , base ) ) output = { } for n in range ( int ( lowN ) , int ( highN ) + 1 ) : x = base ** n label = format ( x ) if self . low <= x <= self . high : output [ x ] = label for i in range ( 1 , len ( output ) ) : keys = sorted ( output . keys ( ) ) keys = keys [ : : i ] values = map ( lambda k : output [ k ] , keys ) if len ( values ) <= N : for k in output . keys ( ) : if k not in keys : output [ k ] = "" break if len ( output ) <= 2 : output2 = self . compute_ticks ( N = - int ( math . ceil ( N / 2. ) ) , format = format ) lowest = min ( output2 ) for k in output : if k < lowest : output2 [ k ] = output [ k ] output = output2 return output