]> git.itanic.dy.fi Git - log-plotter/commitdiff
Add draw_plots.sh
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 5 Oct 2013 19:20:33 +0000 (22:20 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 5 Oct 2013 19:20:33 +0000 (22:20 +0300)
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 <timo.t.kokkonen@iki.fi>
balancing.plot
draw_plots.sh [new file with mode: 0755]
voltage_and_current.plot

index 3a9cfb2f007c665cdbd3d7ffe6a90774310bf8df..48a1764de502cc4bf1b6f8b56830296b3d6969f9 100644 (file)
@@ -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 (executable)
index 0000000..b0686a0
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+gnuplot -e "datafile='$1'" voltage_and_current.plot > voltage.png
+gnuplot -e "datafile='$1'" balancing.plot > balancing.png
index d3e6b772f57666047abe57086a79a881447e46f3..640ca92be96063cc3375a055343f9259dc2b95a2 100644 (file)
@@ -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