gnuplot:有选择地将某些键放在顶部

时间:2015-09-03 16:58:20

标签: gnuplot

我正在尝试使用gnuplot绘制一个数字。由于空间有限,图形如下:

enter image description here

我正在考虑将前三个标签(ins-replacebb-splitfunc-reorder移到图的顶部,在外面!)

所以它应该是这样的:

set key outside

但基本上如何选择前三个键并将它们移到外面?是否可以这样做?

我把我的脚本放在这里:

set term pdf size 10,8 font "Arial,44"
set output "plot/bzip-ropbase-mix.pdf"
set size ratio 0.6
#set multiplot layout 1,1
set datafile separator ","
set offset 0, 0, 0, 0
set xtics norangelimit
set ytics nomirror
set termoption dashed
set ylabel "Gagdet Elimination Rate (%)"
set xlabel "Iteration"
set key bottom right
set yrange [0:110]
set style data linespoints
set key vertical maxrows 5
plot 'plot/bzip-ropbase-data.csv' using 11:xtic((int($0)%4)==0?   sprintf("%d", $0*50):"") title columnheader(11) pt 4 lw 1, \
'' using 12 title columnheader(12) pt 5 lw 4 ps .8 lc rgb "#4169E1", \
'' using 13 title columnheader(13) pt 6 lw 4 ps .8 lc rgb "#DAA520", \
'' using 14 title columnheader(14) pt 7 lw 4 ps .8 lc rgb "#FF7F50", \
'' using 15 title columnheader(15) pt 8 lw 4 ps .8 lc 7

有人能给我一些帮助吗?谢谢!

1 个答案:

答案 0 :(得分:3)

你不能自动执行此操作,但有办法解决它。想到的第一个是使用多重绘图,然后首先绘制你想要的标题以外的所有函数和文件,然后绘制你想要的所有函数和文件。您需要为第一个实例禁用绘制边框等,然后为第二个实例启用它。为确保您的绘图区域在两个plot个实例中保持不变,您需要设置边距:

set multiplot
set xrange [0:2.*pi]

# Set the margins
set lmargin at screen 0.1; set rmargin at screen 0.98
set tmargin at screen 0.8; set bmargin at screen 0.1

# Disable drawing borders and tics
unset border; unset tics

# Set position of the legend
set key tmargin

# Draw the first batch of stuff
plot cos(x) lc 1

# Enable drawing borders and tics
set border; set tics

# Set position of the legend
set key inside

# Draw the second batch of stuff
plot sin(x) lc 2

enter image description here