Browse Source

better temperature hourly plot

tth 1 year ago
parent
commit
e16879a8a2
3 changed files with 11 additions and 6 deletions
  1. 2
    2
      serial/essai.sh
  2. 1
    1
      viz/gnuplot/av4v-h.awk
  3. 8
    3
      viz/gnuplot/plot-two.sh

+ 2
- 2
serial/essai.sh View File

@@ -10,13 +10,13 @@ NB_READ=5000
10 10
 ./t -vv -n ${NB_READ} -d ${DEVICE} | tee -a ${DATAFILE}
11 11
 
12 12
 gnuplot << __EOC__
13
-set term png 	size 3200,640
13
+set term png 	size 4200,640
14 14
 set output 	"${IMAGE}"
15 15
 set grid
16 16
 set title	"Temperature dans le Double Dragon 2"
17 17
 set xdata 	time
18 18
 set timefmt 	"%s"
19
-set format x 	"%a, %H:%M:%S"
19
+set format x 	"%d, %H:%M:%S"
20 20
 set yrange [ 0.0 : 30.0]
21 21
 plot	"${DATAFILE}" using 1:2 title " foo" with lines, \
22 22
 	"${DATAFILE}" using 1:3 title " bar" with lines, \

+ 1
- 1
viz/gnuplot/av4v-h.awk View File

@@ -21,7 +21,7 @@ BEGIN	{
21 21
 		}
22 22
 	else	{
23 23
 		val = cumul /compte;	
24
-		print heures, val;
24
+		print $1, val;
25 25
 		lasthour = heures;
26 26
 		cumul = 0;
27 27
 		compte = 0;

+ 8
- 3
viz/gnuplot/plot-two.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 
3 3
 INFILE="../../serial/foo.dat"
4
-NBLINES=50000
4
+NBLINES=60000
5 5
 TMPFILE="/tmp/dd2data.$$"
6 6
 IMAGE="av4v-h.png"
7 7
 
@@ -14,8 +14,13 @@ set grid
14 14
 set title	"Hourly average on the last ${NBLINES} samples"
15 15
 set xlabel	"Heures"
16 16
 set ylabel 	"Temperature"
17
-set yrange	[ 5.0 : 30.0]
18
-plot "${TMPFILE}" with lines
17
+set yrange	[ 0.0 : 30.0]
18
+
19
+set xdata 	time
20
+set timefmt 	"%s"
21
+set format x 	"%d, %H:%M"
22
+
23
+plot "${TMPFILE}" using 1:2 title "celcius" with lines
19 24
 __EOC__
20 25
 
21 26
 cat -n ${TMPFILE} | tail -20

Loading…
Cancel
Save