I want to export a heat map without interpolation as an EPS file. Using imshow()
with interpolation='nearest'
, if I export as PDF (or PNG or SVG) the image looks right, with no interpolation. But if I export as EPS, it seems to ignore interpolation='nearest'
.
Is there any way to export as EPS without interpolation?
Here is example code demonstrating differences in the export filetype:
import numpy as np
import matplotlib.pyplot as plt
data = np.random.rand(4,4)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.imshow(data,interpolation='nearest')
fig.savefig('test.eps')
fig.savefig('test.pdf')
fig.savefig('test.png')