New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imshow's "nearest" and "none" interpolations produce smoothed images #2023
Comments
Isn't this more an issue with the viewer that you use rather than with mpl? Unless there is some sort of way for mpl to flag the intended interpolation scheme for the rasterized element in the vector files, it is entirely up to the viewer how to treat a 25x25 bitmap that is stretched out to the width of the page. When you choose "none", the raster data is just simply passed through, IIUC, while "nearest" will rescale the raster to the stated dpi of the document. The bluriness you see at the boundaries of the "nearest" image is the product of the viewer. I am not an expert in eps or pdf, so I don't know if there is additional information that mpl can provide to these backends to provide hints to the renderer, but I would imagine that is all we could do, if at all. |
As an alternative, have you tried using pcolor() or pcolormesh()? |
I was expecting (perhaps mistakenly) that either one of |
I thought about it and it seems that I was wrong and the current behavior (of exporting an actual image as a result of |
Tested on:
OSX 10.8.3, python 2.7.4, matplotlib 1.2.1
Ubuntu 12.04 x64, python 2.7.4, matplotlib 1.2.1
Consider the following script:
I expect it to produce a checked image of the random array, with non-smoothed borders between cells. But it does so only for the
png
version; the other two are heavily smoothed (by looking inside the.eps
file, it seems that it just contains the 25x25 bitmap verbatim). If I change theinterpolation
tonearest
, the smoothing is not that heavy, but zooming shows that it still exists near the borders. Also, the produced.eps
file is 1.4Mb since it seems to contain the same effectively 25x25 bitmap, but scaled to much bigger size.The text was updated successfully, but these errors were encountered: