09fd050ccab6659a384d199a84569c4e5c528265
[mirrors/Programs.git] / c / goertzel / sleepplot.sh
1 #!/bin/bash
2
3 test -z "$1" && {
4 echo "Usage: $0 sleeplog.txt"
5 exit 23
6 }
7
8 size="$(tail -n 1 "$1" | cut -d . -f 1)"
9 test $size -gt 3600 && size="$(( $size/10 ))" #For prolonged periods
10 size="$(( 200 + ($size * 2) ))"
11
12 gnuplot << EOF
13 set output "$1.png"
14 set terminal png size $size,200
15
16 set title "Sleep motions"
17 set xlabel "time"
18 set ylabel "motion"
19
20 set yrange [-0.5:1.5]
21
22 set xdata time
23 set timefmt "%s"
24 #set format x "%H:%M:%S"
25
26 #set y2tics 300
27 #set ytics 5
28
29 set grid
30
31 #set pointsize 0.5
32 plot "$1" using 2:5 with histeps;
33
34 EOF
35
36
37
38
This page took 0.38024 seconds and 3 git commands to generate.