-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateGraphs.ps1
More file actions
46 lines (37 loc) · 1.07 KB
/
createGraphs.ps1
File metadata and controls
46 lines (37 loc) · 1.07 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
param (
[string[]]$logFileNames,
[string[]]$legendNames,
[string]$output = "graph.svg",
[string]$title = "Objective value log",
[string]$logScale = "",
[string]$path = $(pwd),
[int]$scale = 1,
[int]$barsEvery = 20,
[string]$limit
)
if ($logScale.Equals("")) {
$plot = "unset logscale
"
}
else {
$plot = "set logscale $logScale
"
}
$plot = $plot + "set term svg solid lw 2
set output `'$output`'
set grid
set title '$title'
set xlabel 'Function evaluations (/$scale)'
set ylabel 'Objective value'
plot [:$limit]"
$color = 0
foreach ($logFile in $logFileNames) {
$name = $legendNames.Get($color)
$color += 1 #powershell has 0 based arrays, gnuplot colors start from 1
$plot = $plot + "`'$path\$logFile.objective_stats`' using (`$1/$scale):4 w l title `'$name`' ls 1 lc $color, `'$path\$logFile.objective_stats`' every $barsEvery using (`$1/$scale):4:3:5 with yerrorbars notitle ls 1 lc $color,"
}
$plot = $plot.Substring(0,$plot.Length - 1);
$plot = $plot + "
set output
set term wxt"
$plot | gnuplot.exe