imshow with pdf

Michael Droettboom <mdroe@...86...> writes:

Keep in mind that we can't control the kind of interpolation used by
the PDF viewer. I don't know if that is what you're seeing.

I think the problem is with image dpi:

% identify maize_raw.jpg
maize_raw.jpg JPEG 400x812 400x812+0+0 DirectClass 8-bit 56.2012kb
% identify maize.png
maize.png PNG 617x617 617x617+0+0 DirectClass 8-bit 297.305kb
% grep Width maize.pdf
<< /Width 220 /ColorSpace /DeviceGray /Height 446 /Subtype /Image
<< /SMask 13 0 R /Width 220 /ColorSpace /DeviceRGB /Height 446

The (812 pixels high) image has been embedded in a png of height 617,
but in the pdf file it has height 446. 446/617 is about .72, so the
problem must be that the pdf backend forces the dpi to 72, while the png
file is being saved with dpi=100. There is a TODO comment in the pdf
backend about figure resolution that I added in February but never got
around to fixing. I'll take a closer look at this later.

···

--
Jouni K. Sepp�nen

Thanks for looking into this Jouni -- please make sure to fix in the
branch and merge to the trunk, as described in
http://matplotlib.sourceforge.net/devel/coding_guide.html#using-svnmerge

···

On Mon, Dec 15, 2008 at 11:04 AM, Jouni K. Seppänen <jks@...397...> wrote:

The (812 pixels high) image has been embedded in a png of height 617,
but in the pdf file it has height 446. 446/617 is about .72, so the
problem must be that the pdf backend forces the dpi to 72, while the png
file is being saved with dpi=100. There is a TODO comment in the pdf
backend about figure resolution that I added in February but never got
around to fixing. I'll take a closer look at this later.