PS and imshow

Petr Danecek <danecek@...1402...> writes:

savefig('foo10.ps', dpi=10)
savefig('foo100.ps', dpi=100)

In fact, the dpi option does change the resulting PS file, but the
quality is still very poor - see the example
  http://www.ucl.cas.cz/~petr/matplotlib-test.tgz

I don't see a big difference between test-600.eps and test-convert.eps
when viewed in gv with magnification 10 and 0.1, respectively. Obviously
there is some resampling in test-600.eps: your source image is 1494 by
1494 pixels large, which at 600 dpi is larger than the 5 by 5 cm figure
created by the script (and the axes are even smaller). test-convert.eps
has a bounding box of 0 0 1494 1494, so obviously it is a non-resampled
image at 72 dpi.

If the problem you are alluding to is in the resampling, perhaps
varying the interpolation algorithm will produce a better result?
See the docstring of imshow.

To get a non-resampled image, figimage should work, but it doesn't seem
to understand PIL images yet...

···

On Fri, 2007-08-24 at 20:03, Jouni K. Sepp�nen wrote:

--
Jouni K. Sepp�nen

OK, I've got it. Previously, I checked the quality of the output image
by two means: by visual inspection in gv and by checking the size of the
output eps images.
I was puzzled by the different sizes of the images at magnification 1.
Also, convert produces much larger eps files.

When the size of the output image is set to 6.3246cm (1494px at 600dpi)
and the axes are turned off, both versions appear identical when
printed.

Thanks for your help,
petr

···

On Thu, 2007-08-30 at 20:35, Jouni K. Seppänen wrote:

I don't see a big difference between test-600.eps and test-convert.eps
when viewed in gv with magnification 10 and 0.1, respectively. Obviously
there is some resampling in test-600.eps: your source image is 1494 by
1494 pixels large, which at 600 dpi is larger than the 5 by 5 cm figure
created by the script (and the axes are even smaller). test-convert.eps
has a bounding box of 0 0 1494 1494, so obviously it is a non-resampled
image at 72 dpi.

If the problem you are alluding to is in the resampling, perhaps
varying the interpolation algorithm will produce a better result?
See the docstring of imshow.

To get a non-resampled image, figimage should work, but it doesn't seem
to understand PIL images yet...