0

我是 Gnuplot 新手,我正在尝试从输入的 .dat 文件构建图表。我的 .dat 文件中的第一列是一个类似于“内部版本号”的数字,我试图将这些数字用作其中一列的值。

对于这个 .dat 文件:

#Version-Number     Average-Error       Average-Performance 
1                       4.100333            41.76998            
2                       4.100333            41.76998

我得到正确的第 1 列和第 2 列。

但是对于这个 .dat 文件:

#Version-Number     Average-Error       Average-Performance 
0.80.0.17598        4.100333            41.76998            
0.80.0.17599        4.100333            41.76998

我得到如下列:0.792 0.794 0.796... 而我正在寻找的值(4.100333)落在 0.8 上。

这是我拥有的 .dat 文件:(称为 CompareResults.dat)

#Version-Number    Average-Error       Average-Performance 
0.80.0.17598        4.100333            41.76998            
0.80.0.17599        4.100333            41.76998            
0.80.0.17602        4.100333            41.76998            
0.80.0.17622        4.100333            41.76998 

我附上了我的代码。

set terminal wxt size 1000,800
set multiplot layout 2, 1 title "Compare Graphs" font ",18"
set tmargin 2
set boxwidth 1 absolute
set style fill   solid 1.00 border lt -1
set grid nopolar
set grid noxtics nomxtics ytics nomytics noztics nomztics \
 nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics
set grid layerdefault   linetype 0 linewidth 1.000,  linetype 0 linewidth 1.000
set pointsize 2
set xtics border in scale 0,0 mirror norotate  offset character 0, 0, 0 autojustify
set xtics   ()
set ytics border in scale 0,0 mirror norotate  offset character 0, 0, 0 autojustify
set ztics border in scale 0,0 nomirror norotate  offset character 0, 0, 0 autojustify
set cbtics border in scale 0,0 mirror norotate  offset character 0, 0, 0 autojustify
set rtics axis in scale 0,0 nomirror norotate  offset character 0, 0, 0 autojustify
set title "Average Error Graph" font ",12"
set xlabel "Build Number" 
set ylabel "Average Error" 
set lmargin 8
set rmargin 4
set tmargin 4
set bmargin 4
plot 'CompareResults.dat' using 1:2 notitle with lines lc rgb "red" lw 3, '' using         1:2:2 with labels offset 1,0.5 notitle

set title "Performance Graph" font ",12"
set xlabel "Build Number" 
set ylabel "Performance" 
plot 'CompareResults.dat' using 1:3:xtic(1) notitle with lines lc rgb "green" lw 3, '' using 1:3:3 with labels offset 1,0.5 notitle
unset multiplot
reset

非常感谢!!!伊丹。

4

0 回答 0