From 8fe679ddbe1cd39a3a1a46c903f6146200f99401 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sat, 5 Oct 2013 22:20:33 +0300 Subject: [PATCH] Add draw_plots.sh This simple helper script draws all plots for a given logfile. The .plot files are adjusted to not use a fixed file name, but instead rely on the calling script to set the file into "datafile" variable. Signed-off-by: Timo Kokkonen --- balancing.plot | 2 -- draw_plots.sh | 4 ++++ voltage_and_current.plot | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100755 draw_plots.sh diff --git a/balancing.plot b/balancing.plot index 3a9cfb2..48a1764 100644 --- a/balancing.plot +++ b/balancing.plot @@ -4,8 +4,6 @@ set datafile separator ";" set ylabel "Voltage (mV)" -datafile = "logfile.log" - samples(x) = $0 > 4 ? 5 : ($0+1) avg5(x) = (shift5(x), (back1 + back2 + back3 + back4 + back5) / samples($0)) shift5(x) = (back5 = back4, \ diff --git a/draw_plots.sh b/draw_plots.sh new file mode 100755 index 0000000..b0686a0 --- /dev/null +++ b/draw_plots.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +gnuplot -e "datafile='$1'" voltage_and_current.plot > voltage.png +gnuplot -e "datafile='$1'" balancing.plot > balancing.png diff --git a/voltage_and_current.plot b/voltage_and_current.plot index d3e6b77..640ca92 100644 --- a/voltage_and_current.plot +++ b/voltage_and_current.plot @@ -2,14 +2,14 @@ set term png size 800,480 set datafile separator ";" -datafile = "logfile.log" - set ylabel "Voltage (mV)" set y2label "Current (mA)" set y2tics border -plot datafile using 7 axes x1y1, \ +plot datafile using 5 axes x1y1, \ datafile using 8 axes x1y1, \ datafile using 9 axes x1y1, \ datafile using 6 axes x1y2, \ datafile using 15 axes x1y2 \ + +#plot datafile using 13 -- 2.45.0