forked from martinpilat/evaTeaching
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateGraphs.sh
More file actions
executable file
·85 lines (73 loc) · 1.43 KB
/
Copy pathcreateGraphs.sh
File metadata and controls
executable file
·85 lines (73 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#bash createGraphs2.sh -logFileNames sga/sgaLog -legendNames sga
output="graph.svg"
title="Objective value log"
logScale=""
path=$(pwd)
scale=1
barsEvery=20
while [ "$1" != "" ]; do
case "$1" in
-logFileNames)
shift
logFileNames=$1
;;
-legendNames)
shift
legendNames=$1
;;
-output)
shift
output=$1
;;
-title)
shift
title=$1
;;
-logScale)
shift
logScale=$1
;;
-path)
shift
path=$1
;;
-scale)
shift
scale=$1
;;
-barsEvery)
shift
barsEvery=$1
;;
-limit)
shift
limit=$1
;;
esac
shift
done
if [ -z $logScale ]; then
plot="unset logscale\n"
else
plot="set logscale $logScale\n"
fi
plot=${plot}"set term svg solid lw 1\n\
set output \"$output\"\n\
set grid\n\
set title \"$title\"\n\
set xlabel \"Function evaluations (/$scale)\"\n\
set ylabel \"Objective value\"\n\
plot [:$limit]"
logFileNames=`echo $logFileNames | tr ',' ' '`
color=0
for logName in $logFileNames ; do
((color++))
name=`echo $legendNames | cut -d',' -f $color`
plot=${plot}"\"${path}/${logName}.objective_stats\" using (\$1/${scale}):4 w l title \"$name\" ls 1 lc $color, \"${path}/${logName}.objective_stats\" every $barsEvery using (\$1/${scale}):4:3:5 with errorbars notitle ls 1 lc $color,"
done
plot=`echo $plot | sed 's/.$//'`
plot="$plot \n\
set output\n\
set term pop\n"
echo -e $plot | gnuplot