I am trying to save an image using plt.imshow and plt.savefig by inputting a certain 2D array that happens to contain NaNs. When I call plt.show() the NaNs map to white but when saved to an eps file they become black.
Here is my MWE, I have set some of the values of data to NaN and they appear black in my .eps file upon saving, depsite showing up initially as white in plt.show() or when saving to a png file.
import numpy as np
import matplotlib.pyplot as plt
plt.figure()
#MWE
data = np.ones([10,10]) #dummy values
data[:,5] = np.nan #set some to NaN for example
image = plt.imshow(data)
cbar = plt.colorbar(image)
plt.show()
plt.savefig("my_image.eps",format="eps")
Am I missing something or is this just a bug ? If not is there a way around this ?

