added sensor temperature, date to x axis
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 12 Oct 2020 09:23:40 +0000 (11:23 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 12 Oct 2020 09:23:40 +0000 (11:23 +0200)
gnuplot/template.gnuplot
gnuplot/template.sql

index 8768927..2b56251 100644 (file)
@@ -16,31 +16,47 @@ set key outside tmargin center
 
 #set ylabel "°"
 #set ylabel "deg."
-set ylabel "degrees"
+#set ylabel "degrees"
 
-set format x "%H:%M"
+#set format x "%H:%M"
+
+set format x ""
 #set format y "%.2f"
 set yrange [ -0.1 : 0.1 ]
 
 #set arrow 1 from first,3 to last,3 nohead linestyle rgb "#ff0000"
 
-set multiplot
-set size 1,0.5
-set origin 0, 0.5
+#set multiplot
+set multiplot layout 3,1
+
+set lmargin at screen 0.125
 
 #set linetype 1 lc 'green'
 set linetype 99 lc 'red'
 
 #plot "axes.txt" using 1:2 with lines title "X angle", "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle
 
-plot "axes.txt" using 1:2:(abs($2) < 3 ? 1: 99) with lines lc variable title "X angle"
+set ylabel "X degrees"
+plot "axes.txt" using 1:2:(abs($2) < 3 ? 1: 99) with lines lc variable notitle
 # http://gnuplot-surprising.blogspot.com/2011/09/gnuplot-background-image.html
 #'/home/dpavlin/zc/www/logo-color.png' binary filetype=png origin=(0,0)  dx=0.5 dy=0.5 with rgbimage notitle
 
-set origin 0, 0
 
-set xlabel "time"
 #plot "axes.txt" using 1:3 with lines title "Y angle", "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle
 
-plot "axes.txt" using 1:3:(abs($3) < 3 ? 2: 99) with lines lc variable title "Y angle"
+set tmargin 0
+
+set ylabel "Y degrees"
+plot "axes.txt" using 1:3:(abs($3) < 3 ? 2: 99) with lines lc variable notitle
 #, "" using 1:(3) with dots notitle, "" using 1:(-3) with dots notitle
+
+set tmargin 0
+
+set xlabel "time"
+set format x "%H:%M\n%d.%m."
+
+set ylabel "celsius"
+set yrange [ * : * ]
+
+plot "axes.txt" using 1:4 with lines lc 'blue' notitle
+
index 87596cb..1677f97 100644 (file)
@@ -1,4 +1,4 @@
-select to_char(time, 'YYYY-MM-DD HH24:MI:SS'), x_axis_angle, y_axis_angle
+select to_char(time, 'YYYY-MM-DD HH24:MI:SS'), x_axis_angle, y_axis_angle, sensor_temperature
 from zc
 where pn = 2008050087 -- and time > now() - interval '24 hours'
 order by time asc