gnuplot cleanup
[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="$(( 600 + $size ))"
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 grid
27
28 #set pointsize 0.5
29 plot "$1" using 2:5 with steps
30
31 EOF
32
33
34
35
This page took 0.293059 seconds and 4 git commands to generate.