By default (when interpolation="nearest") matplotlib is performing nearest neighbor interpolation on the image to the request PDF dpi before storing it in the file. This results in rows and columns of unequal size because the ratio from the original image to the destination resolution is likely not integral.

You can set interpolation="none", which will pass the original image as-is on to the file, but then we can't control the interpolation mode (since there's no way to tell the PDF viewer what sort of interpolation to perform), so that (usually) will result in bicubic interpolation, which is probably not what you want.

Mike

On 06/06/2013 05:52 AM, Michiel de Hoon wrote:
Hi all,

I am trying to draw a heatmap using matshow, which I then save as a PDF.
If I then zoom in in the PDF, I notice that different rows have different 
sizes, and different columns have different sizes. It seems that some 
rows/columns have twice the height/width as other rows/columns.
Attached is a screenshot of part of the PDF after zooming in.
Is there some way to force all rows / columns to have the same height/width?

Best,
-Michiel.


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j


_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to