问题
Dear stack overflow users, I am new to gnuplot. The letters and lines of the legend are misalinged in my output figure of gnuplot.
I used the code below.
Please help me...
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:
If you mean vertical alignment, it can be fixed using set terminal pngcairo instead of set terminal png
Horizontal alignment can be changed in legend options, e.g. set key font "Arial, 15" outside spacing 1.5 Left
来源:https://stackoverflow.com/questions/51906834/in-gnuplot-the-letters-and-lines-of-the-legend-are-misaligned