Reputation: 533
Is there a way to turn off the interpolation of Matplotlib's imshow function when saved as PDF?
EDIT
Running the following code:
import numpy as np
import matplotlib.pyplot as plt
image = np.random.random((200,200))
plt.imshow(image, interpolation='nearest')
plt.savefig('image.pdf')
will create a PDF that looks like:
Zooming in will reveal that the 'pixels' are interpolated:
Is there a way to turn the interpolation off? I am using Matplotlib 2.0.2 and Python 2.7.13.
Thanks!
Upvotes: 1
Views: 1862
Reputation: 11358
I had the same problem and was able to it by using interpolation=None
.
Upvotes: 2