How to achieve consistent output in terms of eps and pdf in gnuplot?

I am trying to get some consistent output between eps and pdf terminals in gnuplot. The trouble is that they seem to understand units differently; the same specified size in inches will result in a significantly larger font size for pdf output:

set terminal postscript eps enhanced colour size 10in,8in font 'Arial-Bold,14'
set output 'my_eps.eps'
set title 'My plot'
plot sin(x) notitle

set terminal pdfcairo size 10in,8in font 'Arial-Bold,14'
set output 'my_pdf.pdf'
replot

The text in .pdf is much larger and the schedule is limited. However, if I changed the unit of measurement for eps size to cm:

set terminal postscript eps enhanced colour size 10cm,8cm font 'Arial-Bold,14'
                                                 ########
set output 'my_eps.eps'
set title 'My plot'
plot sin(x) notitle

set terminal pdfcairo size 10in,8in font 'Arial-Bold,14'
set output 'my_pdf.pdf'
replot

The outputs look the same (with some errors with errors) with the wrong units. That's a coincidence? What's going on here?

This has been tested for Gnuplot 4.4 (patchlevel 3) Ubuntu 11.10.

(I know that I could use some utility to convert between eps and pdf so that they are the same, but I would like to understand what is happening in gnuplot.)

+5
2

- , , / . ( help post)

In `eps` mode the whole plot, including the fonts, is reduced to half of 
the default size.

, , - 2 eps, ( , , - ​​ ...).

- cairo, ... ( ). , , 2, ? (, , 1/2,54)

, , (CURRENTLY UNTESTED):

fontsize(x)=((GPVAL_TERM eq 'postscript') && \
             (strstrt(GPVAL_TERMOPTIONS,"eps")!=0)) ? x*2 : x
set term post eps enh size 10in,8in
set termoption font "Arial,".fontsize(7)
set output "Hello.eps"
plot sin(x)

set term pdfcairo enh size 10in,8in
set termoption font "Arial,".fontsize(7)
set output "Hello.pdf"
plot sin(x)

, fontsize - integers, .

, , () , .

running pdffonts myfile.pdf - , strings myfile.pdf | grep FontName:

name                 type         emb sub uni object ID
-------------------- ------------ --- --- --- ------ --
LiberationSansBold   CID TrueType yes no  yes      5 0

( ), ps , ( [] , ). , ( ), , pdf, set postscript eps enh color fontfile add "<fontfile>", pdf postscript.

+2

100% - Ghostscript

Ghostscript Encapsulated PostScript (EPS), gnuplot PDF. !

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf input.eps
0
source

All Articles