1 # set term postscript eps color solid blacktext "Helvetica" 14
2 # set output 'loradtn.eps'
5 set terminal png nocrop enhanced size 1024,768
6 set output 'loradtn-2017-08-02.png'
8 set datafile separator ","
10 set timefmt "%Y-%m-%d %H:%M:%S"
12 os='2017-08-02 11:00:00'
13 oe='2017-08-02 16:00:00'
14 #os='2017-01-24 14:00:00'
15 #oe='2017-01-25 13:00:00'
17 set title "Loradtn power (Mech. Eng. roof)"
30 set yrange [1500:19000]
31 set y2range [-6000:8000]
54 set y2tics ( 4000, 3500, 3000, 2500, 2000, 1500, 1000, 500, 0, -500, -1000, "spike" -2000 )
57 set style arrow 1 nohead ls 1 lt 3
58 set style arrow 2 nohead ls 2
59 set style arrow 3 nohead lc rgb "green"
60 set style arrow 4 nohead lc rgb "red"
62 # some horizontal lines to help
63 set arrow from os,12000 to oe,12000 as 1
64 set arrow from os,11450 to oe,11450 as 3
65 set arrow from os,11300 to oe,11300 as 4
66 set arrow from os,second 1000 to oe,second 1000 as 2
67 set arrow from os,second 0 to oe,second 0 as 2
68 set arrow from os,second -1000 to oe,second -1000 as 2
72 plot 'sedded-battery.log' using 1: ( ($2 == r1 && $7 != newdata) ? ( ( ($7 == spike) ? 10050 : (10 * $4) ) ) : 1/0 ) axes x1y1 title "mV" with points ps 1, \
73 'sedded-battery.log' using 1: ( ($2 == r1 && $7 != newdata) ? ( ( ($7 == spike) ? -2000 : $5 ) ) : 1/0 ) axes x1y2 title "mA" with points ps 1, \
74 'sedded-battery.log' using 1: ( ($2 == r1) ? (2000 + $6) : 1/0 ) axes x1y1 title "state" with step