From: <jo...@us...> - 2008-02-03 21:10:25
|
Revision: 4933 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4933&view=rev Author: jouni Date: 2008-02-03 13:10:22 -0800 (Sun, 03 Feb 2008) Log Message: ----------- Force the pdf backend to always use 72 as the dpi value. This fixes the size problem of the resulting files (since the size is measured in units of 1/72 inch). TODO: the user now has no control over the dpi of images. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-02-02 21:32:21 UTC (rev 4932) +++ trunk/matplotlib/CHANGELOG 2008-02-03 21:10:22 UTC (rev 4933) @@ -1,3 +1,5 @@ +2008-02-03 Force dpi=72 in pdf backend to fix picture size bug. - JKS + 2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD 2008-01-31 Don't use unicode strings with usetex by default - DSD Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-02 21:32:21 UTC (rev 4932) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-03 21:10:22 UTC (rev 4933) @@ -1853,8 +1853,9 @@ return 'pdf' def print_pdf(self, filename, **kwargs): - dpi = kwargs.get('dpi', 72) - self.figure.set_dpi(dpi) # Override the dpi kwarg + dpi = 72 # there are 72 Postscript points to an inch + # TODO: use the dpi kwarg for images + self.figure.set_dpi(dpi) width, height = self.figure.get_size_inches() file = PdfFile(width, height, dpi, filename) renderer = MixedModeRenderer( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |