title: Python Matplotlib: black squares when saving eps of plot of masked array, why?
body: <p>When I run the following code:</p>
  
  <pre><code>import numpy as np
  import matplotlib
  import matplotlib.pyplot as plt
  
  x_data = np.random.randn(10000)
  y_data = np.random.randn(10000)
  hist, xbins, ybins = np.histogram2d(x_data, y_data, bins=100)
  hist_masked = np.ma.masked_where(hist&lt;1e-3, hist)
  
  cmap = matplotlib.cm.jet
  #cmap.set_bad('w',1.)
  
  fig = plt.figure()
  ax = fig.add_subplot(1,1,1)
  ax.imshow(hist_masked.T, interpolation = 'none', cmap = cmap)
  plt.savefig('test.eps',transparent=False)
  plt.show()
  </code></pre>
  
  <p>the plot looks fine on screen but the eps file has extra black "squares". Why?
  These black squares are present only if I save the plot as eps and even with eps I can get rid of them by uncommenting the "set_bad" command in the code. Why is that command necessary for the plot to work if I am plotting a masked array?</p>
  
  <p>Thanks!</p>