将'stats'命令的输出保存在gnuplot中

时间:2019-05-06 10:54:06

标签: linux statistics gnuplot

我想从600个节点上运行的基准统计分析输出文件。特别是,我需要最小值,上四分位数,中位数,下四分位数,最小值和平均值。我的输出是文件getOrders() { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': 'my-auth-token' }) }; return this.http.get('/api/orders', httpOptions); }

代码:

testrun16-[1-600]

我获得了这些值并可以绘制它们。但是,每次运行中的元组会混合在一起。 ListofFiles = system('dir testrun16-*') set print 'MaxValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_max } set print 'upquValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_up_quartile } set print 'MedianValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_median } set print 'loquValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_lo_quartile } set print 'MinValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_min } set print 'MeanValues.dat' do for [file in ListofFiles]{ stats file using 1 nooutput print STATS_mean } unset print set term x11 set title 'CLAIX2016 distribution of OSnoise using FWQ' set xlabel "Number of Nodes" set ylabel "Runtime [ns]" plot 'MaxValues.dat' using 1 title 'maximum value', 'upquValues.dat' title 'upper quartile', 'MedianValues.dat' using 1 title 'median value', 'loquValues.dat' title 'lower quartile', 'MinValues.dat' title 'minimum value', 'MeanValues.dat' using 1 title 'mean value'; set term png set output 'noises.png' replot 的平均值绘制在testrun16-17.dat上,最小值也在另一个位置。

如何保存输出,但将元组放在一起并在其实际位置上绘制每个节点?

1 个答案:

答案 0 :(得分:1)

Windows(和Linux?)可能有一些特殊的方式来对目录列表中的数据进行排序(或取消排序)。为了消除这种不确定性,您可以按编号循环文件。但是,这假定实际存在从1到最大值(在您的情况下为600,= {FilesCount)的所有数字。 抱歉,您标记了Linux,但是我只知道Windows,而要获取Windows中仅文件名列表的命令是'dir /B testrun16-*'

在7个不同的文件中写入统计数字是否有特殊原因?为什么不将其合并为一个文件?

类似这样的内容:(在OP评论后修改

### batch statistics
reset session

FileRootName = 'testrun16'
FileList = system('dir /B '.FileRootName.'-*')
FilesCount =  words(FileList)
print "Files found: ", FilesCount

# function for extracting the number from the filename 
GetFileNumber(s) = int(s[strstrt(s,"-")+1:strstrt(s,".dat")-1])

set print FileRootName.'_Statistics.dat'
    print "File Max UpQ Med LoQ Min Mean"
    do for [FILE in FileList] {
        stats FILE u 1 nooutput
        print sprintf("%d %g %g %g %g %g %g", \
        GetFileNumber(FILE), \
        STATS_max, STATS_up_quartile, STATS_median, \
        STATS_lo_quartile, STATS_min, STATS_mean)
    }
set print

plot FileRootName.'_Statistics.dat' \
       u 1:2 title 'maximum value', \
    '' u 1:3 title 'upper quartile', \
    '' u 1:4 title 'median value', \
    '' u 1:5 title 'lower quartile', \
    '' u 1:6 title 'minimum value', \
    '' u 1:7 title 'mean value'
### end of code
相关问题