水平键在GNUPLOT中以垂直方式显示

水平键在GNUPLOT中以垂直方式显示,gnuplot,Gnuplot,在gnuplot中,我使用了水平键,但它在输出屏幕上显示垂直。我尝试了各种选择,但发现很难做到这一点 set terminal wxt size 600,600 enhanced font 'times new roman,10' persist set xlabel "X-Axis" set ylabel "Y-Axis" set multiplot layout 2,3 set key box set key horiz set key at screen 0.5, 0.40 set tit

gnuplot
中,我使用了水平键,但它在输出屏幕上显示垂直。我尝试了各种选择,但发现很难做到这一点

set terminal wxt size 600,600 enhanced font 'times new roman,10' persist
set xlabel "X-Axis"
set ylabel "Y-Axis"
set multiplot layout 2,3
set key box
set key horiz
set key at screen 0.5, 0.40
set title "1st"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
        tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
        tan(3*(pi/180)*x) title "Experimental" w lp ls 3

set title "2nd"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
        tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
        tan(3*(pi/180)*x) title "Experimental" w lp ls 3

set title "3rd"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
        tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
        tan(3*(pi/180)*x) title "Experimental" w lp ls 3

unset multiplot
有没有其他可能的选择??通过单击以下输出查看绘图:


三个绘图中的每一个都会生成一个单独的关键点。multiplot布局将所有3个绘图放置在同一页上,但每个绘图的宽度仅为该页的1/3,这设置了其键的最大水平大小。在本例中,您将每个键重新定位到页面底部的同一位置,以便它们正好位于彼此的顶部。这不会改变它们的大小或形状,只会改变它们的位置

您可以改为手动将每个标题放置在页面上,而不参考自动生成的键。为了给手动放置的键条目留出空间,您可以给出明确的多点布局边距

set multiplot layout 1,3 margins .1, .9, .3, .9
set key
plot    tan((pi/180)*x)   title "Analytical"   at screen .25,.1 w l  ls 1,\
        tan(2*(pi/180)*x) title "Observed"     at screen .50,.1 w lp ls 2 ,\
        tan(3*(pi/180)*x) title "Experimental" at screen .75,.1 w lp ls 3
unset key
plot ...
plot ...
unset multiplot

在手动定位的标题周围放置一个框是一个单独的问题。

您可以通过指定
设置键垂直最大行1来强制图例由一行组成:

set xlabel "X-Axis"
set ylabel "Y-Axis"
set multiplot layout 2,3
set key at screen 0.5, 0.40 center vertical height 1 box maxrows 1
set title "1st"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
    tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
    tan(3*(pi/180)*x) title "Experimental" w lp ls 3

set title "2nd"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
    tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
    tan(3*(pi/180)*x) title "Experimental" w lp ls 3

set title "3rd"
set xrange [0:20]
plot    tan((pi/180)*x)   title "Analytical"   w l  ls 1,\
    tan(2*(pi/180)*x) title "Observed"     w lp ls 2,\
    tan(3*(pi/180)*x) title "Experimental" w lp ls 3

unset multiplot