gnuplot postscript+eps 线宽

问题描述

如何在 postscript+eps 终端中调整线宽?我需要得到 linewidth=1.0(边框或轴),linewidth=1.8(data-file1),linewidth=1.0(data-file2)

set terminal postscript eps enhanced font 'Times-Roman,14' lw 1.5
    set output 'figure.eps'
...

plot 'P-Density.txt' u 1:(0.415+$2) axes x1y2 title '(1,0)' w line lt 1 lc 9 lw 1.8,'P-Density.txt' u 1:(0.472+$3) axes x1y2 title '(1,1,0)' w line lt 1 lc 1 lw 1.8,'P-Density.txt' u 1:(0.658+$4) axes x1y2 title '(1,2,0)' w line lt 1 lc 3 lw 1.8,'Potential.txt' u 1:2 title '' w line ls -1 lw 1.2,'enerji2_7_1.txt' u 1:2 title '' w line lt 2 lc 9 lw 1.0,'enerji2_7_2.txt' u 1:2 title '' w line lt 2 lc 1 lw 1.0,'enerji2_7_3.txt' u 1:2 title '' w line lt 2 lc 3 lw 1.0

解决方法

在“postscript”终端中,刻度线的粗细将遵循set border命令设置的线宽,但边框设计为两倍粗。 然后,如果希望边框线为1.0粗细,可以如下设置。

set border lw 0.5

相反,刻度线粗细将设置为 0.5。

如果希望边框线宽与刻度线一致,则需要更改嵌入在输出 postscript 文件标题中的“prologue.ps”文件的内容。 gnuplot 提供了一种机制,可以用您自己定制的“prologue.ps”文件替换此标头。有关详细信息,请参阅 help set psdir

你可以把gnuplot自带的'prologue.ps'文件复制到当前目录下,换行试试,

/LTB {BL [] LCb DL} def

以下。

/LTB {PL [] LCb DL} def

然后,将您的脚本更改为,

set terminal postscript eps enhanced font 'Times-Roman,14' 
set psdir '.'
set output 'figure.eps'

set border lw 1.0

... your plot command ...