I am making a comparison of different algorithms with dependence on the properties of the datasets, and I am watching the execution time. Because there might exist multiple observations for one value of the property, I created a line graph, where lines would correspond to the average values of execution times. However, I also wanted to see extremes and quartiles, so my first idea was to add to the relevant places some candlesticks showing relevant values.
I expected that it should look something like this:
My data are in form of csv with relevant values in it:
size, GSP_min, GSP_firstQuartile, GSP_median, GSP_avg, GSP_thirdQuartile, GSP_max, SPAM_min, SPAM_firstQuartile, SPAM_median, SPAM_avg, SPAM_thirdQuartile, SPAM_max, PREFIX_SPAN_min, PREFIX_SPAN_firstQuartile, PREFIX_SPAN_median, PREFIX_SPAN_avg, PREFIX_SPAN_thirdQuartile, PREFIX_SPAN_max
498101.0, 101.0, 101.0, 385.6666666666667, 340.0, 716.0, 11.0, 11.0, 11.0, 33.666666666666664, 29.0, 61.0, 49.0, 49.0, 49.0, 60.333333333333336, 56.0, 76.0,
730189.0, 189.0, 189.0, 3489.0, 3740.0, 6538.0, 19.0, 19.0, 19.0, 106.66666666666667, 114.0, 187.0, 32.0, 32.0, 32.0, 69.66666666666667, 81.0, 96.0,
Here is my code and how I planned to achieve it:
set terminal png size 1024,1024
set bmargin 5
set key autotitle columnhead
set datafile separator ","
set style line 1 \
linecolor rgb '#00ff00' \
linetype 1 linewidth 2 \
pointtype 7 pointsize 1.5
set style line 2 \
linecolor rgb '#0000ff' \
linetype 1 linewidth 2 \
pointtype 7 pointsize 1.5
set style line 3 \
linecolor rgb '#ff0000' \
linetype 1 linewidth 2 \
pointtype 7 pointsize 1.5
set boxwidth 0.1 relative
set style fill empty
set output 'sizeExp.png'
plot 'size.csv' using 1:4 with lp ls 1, \
'' using 1:9 with lp ls 2, \
'' using 1:14 with lp ls 3, \
'' using ($1-1):3:2:6:5 with candlesticks whiskerbars, \
'' using ($1):8:7:11:10 with candlesticks whiskerbars, \
'' using ($1+1):13:12:16:15 with candlesticks whiskerbars
This is the generated result:
The problem here is twofold:
- Because the values differ a lot, I am not able to set a width. I thought I would manage to do it somehow logically with the "relative" keyword, but instead, I got really weird widths of the boxes.
- Secondly, I am not managing to put these bars next to each other and instead, I am getting them overlapped. I tried different values in the x = "($1+1)" position, but nothing gave me a good result.
Is there a way how to modify values relatively to image size?
And the third problem, if someone could give me some advice, I expected that line would be named "GSP_avg", "SPAM_avg", and "Prefix_span_avg", but instead, I got that mess.