00d275a62fccdebeb5ed75c50b8d087a15966208
4 echo "Usage: $0 sleeplog.txt"
9 graphout
="${in%%.*}.png"
10 test -n "$2" && graphout
="$2";
12 #Approximate size of graph
13 size
="$(tail -n 1 "$in" | cut -d . -f 1)"
14 test $size -gt 3600 && size
="$(( $size/10 ))" #For prolonged periods
15 size
="$(( 600 + $size ))"
19 set output "$graphout"
20 set terminal png size $size,400
22 set title "Sleep motions"
30 #set format x "%H:%M:%S"
36 "$in" using 2:5 title "Sensor state" with steps,\
37 "" using 2:(\$6*2) title "Avg. 10s" with lines,\
38 "" using 2:(\$7*3) title "Avg. 30s" with lines,\
39 "" using 2:(\$8*3) title "Avg. 60s" with lines,\
40 "" using 2:(\$9*3) title "Avg. 90s" with lines,\
41 "" using 2:(\$10*4) title "Avg. 120s" smooth bezier\
This page took 0.268961 seconds and 4 git commands to generate.