title: Handling large long values in matplotlib
body: <p>I currently implement a 2D plot which shall be used to relate those two values to a visual "landscape":</p>
  
  <ul>
  <li>x-axis: huge binary discrete values with a length of up to
  3000 digits (2^3000)</li>
  <li>y-axis: calculated value (no problem)</li>
  </ul>
  
  <p>It seems that matplotlib can not handle such huge values.
  As it represents a landscape, the values itself are not important. What is important is a visual representation of the function itself.
  I tried to log-scale the values, which did not solve the problem. This is the current code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  '''
  convert binary list to gray code to maintain hamming distance
  '''
  def indtogray(self, ind):
      return ind[:1] + [i ^ ishift for i, ishift in zip(ind[:-1], ind[1:])]
  
  '''
  Create int from gray value
  '''
  def graytoint(self, gray):
      i = 0
      for bit in gray:
          i = i*2 + bit
      return i
  
  '''
  Create example list of binary lists
  '''
  def create(self, n, size):
      return [[np.random.randint(2) for _ in range(size)] for _ in range(n)]
  
  def showPlot(self, toolbox, neval):
      individuals = self.create(100, 2000)
      fitnesses = map(np.sum, individuals)
  
      fig,ax = plt.subplots()
      values = map(self.graytoint, map(self.indtogray, individuals))
      full = zip(*sorted(zip(values, fitnesses)))
      line = ax.plot(full[0], full[1], 'r-')
      plt.show()
  
  if __name__ == '__main__':
      show()
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>OverflowError: long int too large to convert to float
  </code></pre>
  
  <p>Anyone an idea?</p>