Petr Danecek wrote:
> Hi,
> I'd like to open a high-quality image (600dpi) in matplotlib, add some
> plots and save it as a postscript file. 
> It seems that whatever I do, the input image gets scaled down
> :-(

I'm sorry I don't know enough about MPL's handling of images to help, but...

> Looking in the code of matplotlib, there is a constant of 72dpi
> hardwired everywhere. For instance, backend_ps.py there is the line
>       self.figure.dpi.set(72) # ignore the dpi kwarg

This may not be what it seems. The native coordinate system for 
PostScript is in points, which are 1/72 if an inch, so it's common to 
force that as a dpi. Postscript supports fractional (is it floating 
point or fixed -- I'm not sure) points, however, so you can define 
things in higher resolution, and I'm pretty sure you can imbed an 
arbitrary dpi image in a a PostScript file, using the 72dpi to positions 
the image.

The problem comes if the code, in addition to using 72dpi, also assumes 
integer coordinates, then you can't get better accuracy that 72dpi, 
which is not very good, and is really bad if someone scales it up later. 
wxWidgets addresses this by hard-coding 720dpi, rather than 72, and 
dividing by ten when writing the postscript -- still a bit of kludge. 
I'm not sure what MPL does.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to