在gnuplot中,图例的字母和行未对齐

时间:2018-08-18 08:39:54

标签: gnuplot

尊敬的堆栈溢出用户, 我是gnuplot的新手。 图例的字母和线条在gnuplot的输出图中被错误处理了。

enter image description here

我使用了下面的代码。

请帮助我...

gnuplot -persist <<EOF
set size ratio 3/4

set tics font "Arial, 15"

set xrange [494:506]
set yrange [0:1]

set xlabel 'wavelenth [nm]' font "Arial, 20"
set ylabel 'probability' font "Arial, 20" offset -2,0

set lmargin 10
set bmargin 6
set rmargin 25

set key font "Arial, 15" outside  spacing 1.5

plot 'result.out' using 1:2 with lines title "transmittance"
replot 'result.out' using 1:3 with lines title "reflectance" lc rgb "dark-    green"
replot 'result.out' using 1:4 with lines title "absorbance"

set terminal png
set output 'out.png'
replot
EOF

1 个答案:

答案 0 :(得分:0)

如果您指的是垂直对齐方式,则可以使用set terminal pngcairo而不是set terminal png来固定它

Legend obtained with pngcairo

可以在图例选项中更改水平对齐方式,例如set key font "Arial, 15" outside spacing 1.5 Left

enter image description here