PS, dpi, and imshow

Hi all,

I have a question about the PS backend (building on the thread "imshow with PS backend" from ~ a month ago). Evidently this backend is fixed at 72 dpi. This isn't a problem with vector information. However, it would seem that one would want to use a higher resolution when plotting figures that use imshow() for raster data, since this command has several choices for interpolation. As I understand, the AxesImage is sampled at this low-resolution when being written to PS/EPS. Subsequent interpolation is done when printing, or viewing with ghostview. For the (originally?) raster data, gv seems to use a nearest-neighbor scheme, making the image blocky. It would be nice to use matplotlib's interpolation instead. Is there a fundamental reason this needs to be fixed at 72 dpi? As some publishers ask for EPS files of e.g. 300 dpi, I would think it's theoretically possible to export at different resolutions. My understanding is that the _preview_ image in the file is supposed to be 72 dpi.

One possible workaround is to scale up the size of the figure (in inches), but then fonts, line thickness, marker sizes, etc. must also be scaled, making it less-than-satisfactory.

Thank you in advance for any enlightenment, and please forgive my ignorance -- I must admit I don't know that much about PS, nor about the specific scheme used in matplotlib for getting the image data into the postscript file, so I may be critically mistaken in the above assessment.

Best,
Mike

(P.S. please cc me, as I'm not subscribed)

I don't know how (or if) this can be improved, but I will gladly consider
patches.

ยทยทยท

On Thursday 31 August 2006 03:09, Michael Fitzgerald wrote:

Hi all,

I have a question about the PS backend (building on the thread
"imshow with PS backend" from ~ a month ago). Evidently this backend
is fixed at 72 dpi. This isn't a problem with vector information.
However, it would seem that one would want to use a higher resolution
when plotting figures that use imshow() for raster data, since this
command has several choices for interpolation. As I understand, the
AxesImage is sampled at this low-resolution when being written to PS/
EPS. Subsequent interpolation is done when printing, or viewing with
ghostview. For the (originally?) raster data, gv seems to use a
nearest-neighbor scheme, making the image blocky. It would be nice
to use matplotlib's interpolation instead. Is there a fundamental
reason this needs to be fixed at 72 dpi? As some publishers ask for
EPS files of e.g. 300 dpi, I would think it's theoretically possible
to export at different resolutions. My understanding is that the
_preview_ image in the file is supposed to be 72 dpi.

One possible workaround is to scale up the size of the figure (in
inches), but then fonts, line thickness, marker sizes, etc. must also
be scaled, making it less-than-satisfactory.

Thank you in advance for any enlightenment, and please forgive my
ignorance -- I must admit I don't know that much about PS, nor about
the specific scheme used in matplotlib for getting the image data
into the postscript file, so I may be critically mistaken in the
above assessment.