-
Notifications
You must be signed in to change notification settings - Fork 2
/
timeplot_daily.gpl
executable file
·29 lines (23 loc) · 1 KB
/
timeplot_daily.gpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/gnuplot -persist
reset;
set encoding utf8;
ID=100022;
CONFIG_TZ="JST";
qCOMMA='","';
DAYSPLITTER="perl -e 'while(<>){/^(.+?),/; print " . '"\n"' . " if ($last ne $1); $last=$1; print;}'";
DATAFILE=sprintf("<(cat cache/%d.csv| perl -ne '@R=split/,/; $R[0] =~ m/(\\d\\d\\d\\d-\\d\\d-\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)/; $s=$2*3600+$3*60+$4; print join(%s, $1, $s, @R);' |%s)", ID, qCOMMA, DAYSPLITTER);
#print DATAFILE;
set datafile separator ",";
set xrange [0:86399]; set xdata time; set format x "%H:%M\n" . CONFIG_TZ; set xtics 3600 offset graph 0,graph 0.05;
set ydata time; set timefmt "%Y-%m-%d"; set format y "%Y-%m-%d"; set ytics 86400 offset graph 0.01, graph 0;
set title sprintf("sensor=%d", ID);
set grid x;
set grid y;
set hidden3d offset 0;
#set dgrid3d 30, 24*2;
#set samples 300;
set pm3d at b;
set palette defined ( 0 "green", 1 "blue", 2 "red", 3 "orange" );
set border 4095;
set view 110,350; set xyplane 2;
splot DATAFILE using (timecolumn(2,"%s")):1:5 w l lw 4 palette title "SMA large";