图例位置多图gnuplot

时间:2018-07-09 16:38:01

标签: gnuplot

我正在使用Windows 10和Gnuplot 5.0。 我有一个脚本可以同时绘制多个图形:

GNUTERM = "wxt"
set terminal wxt
set termoption enhanced
set encoding iso_8859_1
set multiplot layout 1,3
set xtics out
set ytics out
set xtics nomirror
set ytics nomirror
set xzeroaxis linetype 2 linewidth 1.5
show xzeroaxis
# Graph1
set key center right
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set title "Title 1"
set xlabel "x"
set ylabel "y"
plot \
"results_1.dat" u 1:2:4 title "exp." with e pointtype 9 pointsize 0.5 linecolor rgb "red" , \
"results_1.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph2
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key top right
set title "Title 2"
set xlabel "x"
set ylabel "y"
plot \
"results_2.dat" u 1:2:4 title "exp." with e pointtype 9 pointsize 0.5 linecolor rgb "blue", \
"results_2.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
# Graph3
set xrange [3.3:9.0]
set yrange [-0.1:1.10]
set key outside vertical top right
set title "Title 3"
set xlabel "x"
set ylabel "y
plot \
"results_3.dat" u 1:2:4 title "exp." with e pointtype 9 linecolor rgb "red", \
"results_3.dat" u 1:3 title "fit." with line linecolor rgb "black" linewidth 2 dashtype 2 smooth bezier
unset multiplot
pause 3
reread

但是,不是将图例仅显示在图3的外部,而是将所有图例显示在图的外部(请参见附图)

plot gnuplot

我希望图例内的图例1和2以及图外的图例3。我的脚本出了什么问题?

感谢您的帮助。

Supernono06

1 个答案:

答案 0 :(得分:1)

很难说不能运行您的脚本,但是如果我不得不猜测,我想说您要求图例在图3之外,而当您reread使用脚本时,您不会放回里面。尝试类似

set key inside center top

对于第一个图形(或在脚本的开头添加reset语句)。