-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot.p
76 lines (64 loc) · 2.25 KB
/
plot.p
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
# obtain y min max values
set terminal unknown
plot DATA using ($1/STEPSIZE):5:6 with yerrorbars pointtype 2 pointsize 0.2
Y0_MIN=GPVAL_Y_MIN
Y0_MAX=GPVAL_Y_MAX
# obtain y min max values
set logscale y
plot DATA using ($1/STEPSIZE):13 with line
Y1_MIN=GPVAL_Y_MIN
Y1_MAX=GPVAL_Y_MAX
unset logscale y
set term TERM size 800,600
set out IMG
set datafile missing "-"
set lmargin 10
set ytics nomirror
unset key
set style line 1 pointtype 2 pointsize 0.2 linecolor 1 #estimates
set style line 2 linecolor 2 #true value
set style line 3 linetype 0 linecolor 3 #join
set style line 4 linetype 0 linecolor 6 #leave
set style line 5 linecolor 10 #variation
set style line 6 linecolor 6 #rmse
set multiplot layout KEY+2, 1 title TITLE
#plot estimates and true value
unset xtics
set xrange [0:STEPS]
set bmargin 0.5
plot DATA using ($1/STEPSIZE):5:6 with yerrorbars linestyle 1, \
DATA using ($1/STEPSIZE):14 with line, \
DATA using ($1/STEPSIZE):($15*Y0_MAX) with impulses linestyle 3, \
DATA using ($1/STEPSIZE):($15*Y0_MIN) with impulses linestyle 3, \
DATA using ($1/STEPSIZE):($16*Y0_MAX) with impulses linestyle 4, \
DATA using ($1/STEPSIZE):($16*Y0_MIN) with impulses linestyle 4, \
DATA using ($1/STEPSIZE):17 axes x1y2 with impulses linestyle 5
#plot rmse
set xlabel "steps (time/stepsize)"
set xrange [0:STEPS]
set xtics auto
set logscale y
set format y "%.0e"
set tmargin 0.5
set bmargin 3
plot DATA using ($1/STEPSIZE):13 with line linestyle 6, \
DATA using ($1/STEPSIZE):($15*Y1_MAX) with impulses linestyle 3, \
DATA using ($1/STEPSIZE):($15*Y1_MIN) with impulses linestyle 3, \
DATA using ($1/STEPSIZE):($16*Y1_MAX) with impulses linestyle 4, \
DATA using ($1/STEPSIZE):($16*Y1_MIN) with impulses linestyle 4, \
DATA using ($1/STEPSIZE):17 axes x1y2 with impulses linestyle 5
#plot key
set key center right
unset tics
unset xlabel
unset ylabel
unset logscale
set yrange [0:1]
plot DATA using (2):(2):(2) with yerrorbars linestyle 1 title "estimates (mean ± std)", \
2 linestyle 2 title "true mean", \
2 linestyle 6 title "rmse", \
2 linestyle 3 title "node joining", \
2 linestyle 4 title "node leaving", \
2 linestyle 5 title "value variation"
unset multiplot
set term pop