From a314c6b8eb9870c7d6d73f193ffa6ff17de91225 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 1 Apr 2017 11:34:25 +0200 Subject: [PATCH] generate single gnuplot image --- temp.gnuplot | 16 ++++++++++------ temp.sh | 11 +++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/temp.gnuplot b/temp.gnuplot index 50a476b..9540a21 100644 --- a/temp.gnuplot +++ b/temp.gnuplot @@ -1,17 +1,21 @@ -set terminal png size 600,250 +set terminal pngcairo mono size 600,800 set xdata time set timefmt "%s" set pointsize 0.2 -set output '/dev/shm/1.png' +set output '/dev/shm/temp.png' + +set multiplot +set size 1, 0.5 + +set origin 0.0, 0.5 + plot "/dev/shm/temp.tsv" using 1:2 with points title "DS18B20 deg. C","/dev/shm/temp.tsv" using 1:($3 > 1 && $3 < 45 ? $3 : '') with dots title "DHT22 deg. C" -set output '/dev/shm/2.png' -plot "/dev/shm/temp.tsv" using 1:($3 > 1 && $3 < 45 ? $3 : '') with dots title "DHT22 deg. C" +set origin 0.0, 0.0 -set output '/dev/shm/3.png' plot "/dev/shm/temp.tsv" using 1:($4 > 3 ? $4 : '') with dots title "DHT22 % hum" - +unset multiplot diff --git a/temp.sh b/temp.sh index 0f9030f..ccd7266 100755 --- a/temp.sh +++ b/temp.sh @@ -6,10 +6,17 @@ tail -4320 `ls -t /dev/shm/vaillant.* | head -1` | sed "s/ .*| */ /" > /dev/shm/temp.tsv cd /home/pi/vaillant-thermostat/ gnuplot temp.gnuplot +convert /dev/shm/temp.png -gravity center -extent 600x800 -colorspace Gray /tmp/m1.gray.png + +echo Location: http://192.168.3.2/m1.gray.png +echo + +exit 0 + montage /dev/shm/[1-3].png -tile 1x3 -geometry +0+0 /tmp/m1.png -#convert /tmp/m1.png -gravity center -extent 600x800 /tmp/m1.pgm +convert /tmp/m1.png -gravity center -extent 600x800 /tmp/m1.pgm convert /tmp/m1.png -gravity center -extent 600x800 -colorspace Gray /tmp/m1.gray.png -#display /tmp/m1.pgm +display /tmp/m1.pgm echo Location: http://192.168.3.2/m1.gray.png echo -- 2.20.1