Closed
Description
I am finding that matplotlib v1.3.0 will blur the edges of an image's pixels when I use interpolation = 'none' and save the image as a pdf. For example, the following code
z = np.array([[0.25, 0.75, 1.0, 0.75], [0.1, 0.65, 0.5, 0.4], [0.6, 0.3, 0.0, 0.2], [0.7, 0.9, 0.4, 0.6]])
fig1 = plt.figure()
ax = plt.subplot()
ax.imshow(z, interpolation = 'none')
plt.savefig('none.png')
produces the following png,
which looks just like the matplotlib figure window, as it should. However, when I save the figure as a pdf
plt.savefig('none.pdf')
I get the following pdf,
Perhaps this is the intended mode of operation, but IMHO the output file should look like the figure window. Fortunately, there is a work around. If use interpolation = 'nearest', everything is hunky dory:
fig2 = plt.figure()
ax = plt.subplot()
ax.imshow(z, interpolation = 'nearest')
plt.savefig('nearest.pdf')
Metadata
Metadata
Assignees
Labels
No labels