1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
echo -e "set xdata time\n
         set timefmt \"%H:%M:%S\"\n
         set format x \"%H:%M\"\n
         set format y \"%.2f\"\n
         set xlabel \"Time [h]\"\n
         set ylabel \"Voltage [V]\"\n
         set y2label \"Battery level [%]\"\n
         set ytics nomirror\n
         set y2tics\n
         set title \"$1\"\n
         plot \"$1\" using 1:(\$5/1000) with lines axis x1y1 title \"voltage\"\n
         replot \"$1\" using 1:3 with lines axis x1y2 title \"level\"\n" | gnuplot -persist