title: Python savefig of large matrix uses ridiculous amount of memory
body: <p>I was playing with the MovieLens10M Dataset and wanted to get some visualizations.. in short, my code looks like this:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  M= np.random.randint(2, size=(70000,10000))
  plt.figure(figsize = (2,1), dpi=5)
  plt.imshow(M,interpolation='nearest')
  plt.axis('off')
  
  plt.savefig('pic.png',dpi=5)
  </code></pre>
  
  <p>The matrix takes about 6GB in memory, but the required memory explodes as soon as savefig is invoked- it goes up to 20GB until I stop the script.. Setting dpi=5 and the figure size so small were only desperate attempts to get some output..</p>
  
  <p>Are there possibilities to tell the savefig function that it doesnt have to make such a fuzz or do I really need to, e.g., sample??  </p>