The horizontal key displays in vertical in GNUPLOT

后端 未结 2 1969
鱼传尺愫
鱼传尺愫 2021-01-23 14:48

In gnuplot, I used the horizontal key, but it shows me vertical on the output screen. I tried every alternative but found difficult to do that.

set         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 15:02

    You can force the legend to consist of a single row by specifying set key vertical maxrows 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
    

提交回复
热议问题