# set term postscript eps color solid blacktext "Helvetica" 14 # set output 'r3.eps' # set size 4,4 set terminal png nocrop enhanced size 1024,668 set output 'r3-power.png' load '/data/summer2010/scripts/gen-power-header.gpl' set title "Router 3 power" set key below r1=1700 r2=1800 r3=1900 r4=2000 nospike=0 spike=1 newdata=2 set yrange [1500:17000] set y2range [-6000:8000] set ylabel "mV" set y2label "mA" set ytics nomirror set ytics (\ "OVERRIDE" 5000,\ "UP" 4500,\ "STBYSHORT" 4000,\ "STBYLONG" 3500,\ "SLEEP" 3000,\ "OFF" 2500,\ "14500" 14500,\ "14000" 14000,\ "13500" 13500,\ "13000" 13000,\ "12500" 12500,\ "12000" 12000,\ "11500" 11500,\ "11000" 11000,\ "spike" 10050) set y2tics ( 4000, 3500, 3000, 2500, 2000, 1500, 1000, 500, 0, -500, "spike" -1000 ) set pointsize 1 plot 'battery.csv' using 1: ( ($2 == r3 && $7 != newdata) ? ( ( ($7 == spike) ? 10050 : (10 * $4) ) ) : 1/0 ) \ axes x1y1 title "r3 mV" with points ps 0.1, \ 'battery.csv' using 1: ( ($2 == r3 && $7 != newdata) ? ( ( ($7 == spike) ? -1000 : $5 ) ) : 1/0 ) \ axes x1y2 title "r3 mA" with points ps 0.1, \ 'updown-state/state.csv' using 1: ( ($2 == r3) ? (2500 + $3) : 1/0 ) axes x1y1 title "state" with step # 'starts.log' using 1: ( ($3 == r2) ? 17000 : 1/0 ) axes x1y1 title "starts" with points ps 1, \ # 'exits.log' using 1: ( ($3 == r2) ? 16800 : 1/0 ) axes x1y1 title "exits" with points ps 1, \ # 'contacts-down.log' using ( ($3 == r2) ? $19 : 1/0 ) : (18000) : 19 : 20 : (18000) : (18100 + 25*rand(0)) \ # axes x1y1 title "contacts" with boxxy