How to ‘turn off’ blurry effect of imshow() in matplotlib?

By default (which is changed mpl 2.0), imshow interpolates the data (as you would want to do for an image). All you need to do is tell it to not interpolate:

im = plt.imshow(..., interpolation='none')

'nearest' will also work for what you want. See smoothing between pixels of imagesc\imshow in matlab like the matplotlib imshow for examples of all of the kinds of interpolation.

doc

Leave a Comment