#
#
#   GNUPLOT - data plot from Lumiera
#

set term wxt size 600,600


set datafile separator ",;"

####---------Data--------------------------------
$RunData << _End_of_Data_
"load size","result time","concurrency","avg jobtime","avg impeded"
43,8.636836,5.47468089008521,1099.62606976744,2.52183720930233
93,26.908743,2.56734578794706,742.839225806452,188.25976344086
75,15.820093,3.30725609514432,697.614653333333,52.9558666666667
131,26.428591,3.616400511098,729.590610687023,1.24181679389313
119,24.15819,3.85807815072239,783.228445378151,2.23156302521008
185,37.591041,3.7520257286836,762.392178378379,29.0166054054054
41,6.880802,4.31080868189493,723.459048780488,27.0829268292683
98,19.653472,3.64645290155348,731.280204081633,5.27408163265306
121,24.051169,3.5910388804802,713.790768595042,32.4789090909091
139,28.090693,3.47401917069116,702.069107913669,34.8621798561151
64,13.393712,4.0976385784613,857.540484375,10.0011875
184,37.108684,3.53275616025618,712.477891304348,2.09190760869565
78,18.921565,2.71536968532994,658.705692307693,82.1700512820513
118,26.658957,2.83160387707591,639.725474576271,108.319347457627
166,33.589537,3.22544252396215,652.657355421687,32.881078313253
135,27.235694,3.53119927841751,712.404911111111,26.3981333333333
58,7.141216,5.60710528851109,690.371551724138,17.0463448275862
136,27.387405,3.72205658038795,749.540227941176,80.8050441176471
53,17.931685,1.92801167319189,652.311283018868,24.3333018867925
72,14.636963,4.3122036313134,876.632847222222,13.7587361111111
60,18.188159,2.13008424876866,645.705183333333,100.166383333333
192,38.780127,3.53985385349563,714.979072916667,1.82634375
152,31.034915,3.69955271345193,755.363842105263,11.4056710526316
181,36.4724,3.84462777332997,774.711613259669,26.8866022099448
85,17.383982,3.39731926781793,694.811023529412,2.29705882352941
118,20.375271,4.46922075294115,771.708338983051,5.79375423728814
142,28.870534,3.34539156774862,680.163669014084,63.9251056338028
149,30.09014,3.61821895810388,730.689362416107,1.92344295302013
196,39.41001,3.78412900681832,760.880418367347,25.665056122449
183,36.975648,3.72883104036473,753.420459016394,2.47966666666667
182,36.757653,3.57614184452963,722.25593956044,56.2165054945055
40,12.165464,2.62321659083451,797.816175,32.148575
75,12.948139,3.63023265351106,626.730093333333,10.9645066666667
56,11.446777,4.72160076150693,965.126982142858,5.38482142857143
140,28.516713,3.45315636483069,703.376207142857,27.5876285714286
165,33.291917,3.51991547978448,710.210509090909,14.2399454545455
41,10.196795,3.60956967360823,897.708341463415,137.913902439024
151,30.432115,3.23020841633912,651.007112582781,53.5216357615894
62,11.787079,4.40271325915437,837.018209677419,1.32517741935484
132,27.058347,3.77599067674016,774.030803030303,27.7883484848485
90,18.457616,4.15023099407854,851.148555555556,4.60322222222222
96,15.160173,4.7719223256885,753.574666666667,11.3016770833333
116,23.435105,3.15719029208531,637.836948275862,99.4875517241379
138,27.810283,3.2704919615525,659.081934782609,78.9682753623188
184,37.170721,3.68864480729335,745.160798913043,7.12672826086957
83,17.028773,3.6115818209568,740.973578313253,4.92331325301205
73,15.594583,2.87202639531945,613.53498630137,5.09360273972603
43,12.828224,2.76669319151271,825.38976744186,23.1223953488372
188,38.143029,3.56482559368843,723.26194680851,1.19660638297872
96,19.626924,3.76855441025807,770.470114583333,5.41494791666667
85,11.552879,5.82613104491097,791.865729411765,3.60017647058824
48,12.221377,2.2205017486982,565.3664375,186.669604166667
88,13.987957,4.06567985589318,646.256306818182,2.51251136363636
37,17.710473,1.13015185986281,540.960108108108,410.624621621622
199,40.006723,3.38209727899983,679.932809045226,8.41501005025126
142,28.564952,3.65154217658058,734.550190140845,19.7686830985915
125,25.277989,3.84072846934145,776.687136,14.180904
141,28.547534,3.41566154190411,691.551163120567,6.5322695035461
92,16.575694,3.96867232225691,715.03802173913,1.50796739130435
122,22.726996,3.91264745239538,728.874778688524,45.1266967213115
124,25.088678,2.54309585383494,514.539620967742,109.820387096774
73,14.871936,3.58092019761247,729.523506849315,44.2219589041096
131,26.332903,3.00676347761582,604.40313740458,94.4729465648855
169,34.140142,3.78017944389335,763.644159763314,51.814550295858
100,20.192983,3.63811691417757,734.64433,54.45321
71,13.325791,4.26514230937586,800.512605633803,17.5440845070423
134,27.094559,3.54328210324442,716.445268656716,67.796723880597
111,24.377955,3.41665890350524,750.370783783784,118.771900900901
192,38.680898,3.43369608430497,691.76275,4.71284375
166,33.711279,3.69578917489307,750.540843373494,50.0127228915663
43,9.119694,4.39974411422138,933.123720930233,3.01481395348837
82,18.804953,3.54320130446484,812.557731707317,27.7167926829268
62,12.592702,3.06591008029889,622.711161290323,9.63659677419355
130,26.137617,4.0830164050533,820.925530769231,28.3186615384615
190,38.367218,3.58517813306141,723.964794736842,1.98525789473684
47,13.325866,3.74684279430695,1062.33882978723,154.121382978723
182,37.015108,3.5805424368882,728.209697802198,1.67770879120879
63,12.794701,3.39708977958922,689.916634920635,62.6871428571429
200,40.321327,3.48643151055024,702.887725,1.57428
30,5.780155,4.24835493165841,818.538333333333,91.5525666666667

_End_of_Data_


#
#---common-styles-for-plots-from-Lumiera---------
set style line 1 linetype  1 linewidth 2 linecolor rgb '#240CC3'
set style line 2 linetype  3 linewidth 2 linecolor rgb '#1149D6'
set style line 3 linetype  2 linewidth 2 linecolor rgb '#0B7FCC'
set style line 4 linetype  6 linewidth 2 linecolor rgb '#37999D'
set style line 5 linetype  7 linewidth 2 linecolor rgb '#248269'
set style line 6 linetype 13 linewidth 2 linecolor rgb '#00C443'
set style line 7 linetype 12 linewidth 2 linecolor rgb '#EBE83E'
set style line 8 linetype  5 linewidth 2 linecolor rgb '#762C14'
set style line 9 linetype  4 linewidth 2 linecolor rgb '#AA0519'

set style line 10 linetype 1 linewidth 1 linecolor rgb '#303030'
set style line 11 linetype 0 linewidth 1 linecolor rgb '#A0A0A0' dashtype 3
#---(End)styles----------------------------------

#
#---axis-and-grid-setup--------------------------
unset border
set tics nomirror
set grid back linestyle 11

set arrow 10 from graph 0,0 to graph 1.04,0 size screen 0.025,15,60 filled ls 10
set arrow 11 from graph 0,0 to graph 0,1.08 size screen 0.025,15,60 filled ls 10


set xlabel 'load size ⟶ number of jobs'
set ylabel 'active time ⟶ ms' 
set key autotitle columnheader tmargin

#
stats $RunData using 1:2 nooutput

# regression line function derived from data
regLine(x) = STATS_slope * x + STATS_intercept
#
regLabel = sprintf("Model: %3.2f·p + %3.2f", STATS_slope, STATS_intercept)

set key horizontal width -4
set xtics 10

plots = STATS_columns - 1
# Adjust layout based on number of data sequences;
# additional sequences placed into secondary diagram
#
if (plots > 1) {
    set multiplot layout 2,1     # 2 rows 1 column
    set lmargin at screen 0.12   # fixed margins to align diagrams
    set rmargin at screen 0.88
}
#
#
####---------Scatter-Regression-Plot-------------
plot $RunData using 1:2 with points linestyle 1, \
     regLine(x)         with line   linestyle 9 title regLabel

if (plots > 1) {
    # switch off decorations for secondary diagram
    unset arrow 10
    unset arrow 11
    set border 2+8
    set key bmargin vertical

    unset xlabel
    set format x ""
    set ylabel 'concurrent threads ⟶' 
    if (plots <= 2) {
        ####---------------------------------
        plot $RunData using 1:3 with impulses linestyle 3

    } else {
        # more than one additional data sequence
        #
        set y2tics
        set y2label 'avg job time ⟶ µs'  offset -1.5

        ####---------------------------------------------
        plot             $RunData using 1:3 with impulses linestyle 3, \
             for [i=4:*] $RunData using 1:i with points   linestyle 5+(i-4) axes x1y2
    }
}

