On Apr 20, 2009, at 11:36 PM, Shai Ayal wrote:
On Tue, Apr 21, 2009 at 4:07 AM, Ben Abbott <address@hidden> wrote:
I noticed that converting an eps-file to a bitmap does not give
the same
result as printing a bitmap.
This is a because gnuplot's ps terminal does not produce the same
output as it's jpeg terminal, it's not a fault of gs. I generally
find
gnuplot's ps terminal to be th most complete, so I always use it, and
convert to pdf/png/jpeg as necessary.
For me, the ps and eps output have different font sizes. The ps
result is correct. I'll do as you suggest and use it.
Consider the example ...
figure (1)
clf
plot (1:10)
set (gca, "fontsize", 12)
xlabel ("my xlabel")
ylabel ("my ylabel")
title ("my title")
print (gcf, "-djpeg", "test.jpeg")
print (gcf, "-deps", "test.eps")
system ("gs -r150 -sDEVICE=jpeg -sOutputFile=test_gs.jpeg -
dEPSCrop
-dBATCH test.eps")
The quality of the converted jpeg is degraded and the fontsize is
different.
If the fontsize is increased by 50%, then the proper size is
obtained (I may
be off by a point or two).
I would recommend the following gs command line to convert from eps:
sprintf("gs -r%s -q -dBATCH -dEPSCrop -dSAFER -dNOPAUSE
-dTextAlphaBits=4 -sDEVICE=%s -sOutputFile=\"%s\" \"%s\"", res , dev,
outfile, infile);
BTW, I would not recommend using jpeg for graphs -- jpeg's lossy
compression algorithm is really geared towards compressing photos,
and
degrades the picture in a very noticeable way for graphs. I would use
png which has lossless compression and compresses graphs very well.
Shai
Thanks Shai! I'll do as you suggest.
Ben