Arrara
Arrara

Reputation: 173

How to create .eps image in gnuplot?

I have script:

set term eps size 1200,150
set output "file.eps"
#set term pngcairo size 1200,150
#set output "file.png"
set tics out
set xlabel "{/:Italic G}" 
set ylabel " " 
set ytics nomirror 
set xtics nomirror 
unset ytics
unset key 
#set key tc variable
set label "{/:Bold=12 A}" tc rgb "black" at 54250,5.05 
set label "{/:Bold=12 D}" tc rgb "black" at 56170,5.05
set label "{/:Bold=12 E}" tc rgb "black" at 56730,5.05
set arrow from 56000,graph(0,0) to 56000,graph(1,1) nohead dt "-" lw 1 lc rgb "grey30"
set arrow from 56500,graph(0,0) to 56500,graph(1,1) nohead dt "-" lw 1 lc rgb "grey30"
plot 'data.txt' title "{/:Bold data}" with points pt 7 ps 1 linecolor rgb "black"

that create good image in term pngcairo, but when I want .eps, the image is not possible to open. It is loading all the time. The size of the file is 61 Mb. I compile the script using gnuplot file.gnu

EDIT - after advice

The picture .eps enter image description here

The picture .png - desired output enter image description here

Upvotes: 0

Views: 1166

Answers (1)

maij
maij

Reputation: 4218

It seems that the error depends on the specific terminal type. Let's consult the documentation, from within gnuplot this works with help term eps:

The output is:

Ambiguous request 'term eps'; possible matches:

term epscairo
term epslatex

So eps is only an abbreviation for one of epscairo or epslatex. We call manually from within gnuplot set term eps and get the output

Terminal type set to 'epscairo'

OK, we are on epscairo. Next step is of course help term epscairo, and we see:

Please read the help for the `pdfcairo` terminal.

We are very close :) and type help term pdfcairo. Here we find some important information:

... The size option changes this to whatever the user requests. By default the X and Y sizes are taken to be in inches, but other units are possible (currently only cm). ...

This means the size 1200, 150 does not create an image of size 1200x150 pixels as with the pngcairo terminal, it creates an eps file with size 1200x150 inches which might be too large for the eps viewer. Default is size 5,3.

Upvotes: 1

Related Questions