来自具有多个指标的文件的gnuplot

时间:2017-10-07 17:26:08

标签: c gnuplot

我有一个C程序写入三个文件,第一列是X值(时钟周期)。其他列是一组指标,如内存使用百分比,内存和#34;孔"等。就像我之前说过的,有三个这样的文件(每个算法一个:首先适合,最适合和最差适合)。

示例 - 标题:时钟周期,%内存使用量和"孔数":

文件1(First Fit):

1 20% 5
2 30% 9
3 70% 12
4 90% 3

文件2(最适合):

1 15% 3
2 20% 5
3 80% 7
4 40% 3
5 60% 9

文件3(最适合):

1 15% 3
2 20% 5
3 80% 7

我想知道gnuplot是否有办法为每个指标生成一个图表,比较这些指标中的三种算法。

顺便说一句,抱歉我的英文,希望你们明白。

1 个答案:

答案 0 :(得分:0)

set term pngcairo size 600,400

set output 'memory.png'
plot 'file1' using 1:2 w lp, \
'file2' using 1:2 w lp, \
'file3' using 1:2 w lp

set output 'holes.png'
plot 'file1' using 1:3 w lp, \
'file2' using 1:3 w lp, \
'file3' using 1:3 w lp

.......

(如果你在第二栏中摆脱'%'会更好)