]> git.itanic.dy.fi Git - log-plotter/commitdiff
plotter scripts: Add automatic x-axis tick scaling
authorTero Salminen <tero.s@lminen.com>
Sat, 12 Oct 2013 19:53:27 +0000 (22:53 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 12 Oct 2013 19:53:27 +0000 (22:53 +0300)
Change the x-tics based on the maximum timestamp. This makes the plot
graphs look better when they are being re-plotter real time during
charging.

Signed-off-by: Tero Salminen <tero.s@lminen.com>
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
bal.plot
cell_volt.plot
volt_cur.plot

index df161e65a54a28240e8d7891df05f7e9b9fa969b..e580b88d947ca1022d7f878b9b9c0ac0b89fe1fa 100644 (file)
--- a/bal.plot
+++ b/bal.plot
@@ -45,16 +45,16 @@ set grid y
 set xlabel "Time [minutes]"
 set format x "%.0f"
 
-# extract the 'time' cell for xtics based on tital time
-stats datafile every ::::0 using 3 nooutput
-time = int(STATS_min)
-
-if (time <= 120) set xtics 0.5 nomirror;
-if (time <= 300) set xtics 1 nomirror;
-if (time <= 900) set xtics 2 nomirror;
-if (time <= 1200) set xtics 3 nomirror;
-if (time <= 1800) set xtics 5 nomirror;
-if (time > 1800) set xtics 10 nomirror;
+# extract the 'time' cell for xtics
+stats datafile nooutput
+stats datafile u (lastdatapoint=$3) every ::STATS_records-1::STATS_records-1 nooutput
+time= int(STATS_max)
+
+#set xtics based on elapsed time
+set xtics 1 nomirror
+if (time > 300) set xtics 1 nomirror;
+if (time > 900) set xtics 2 nomirror;
+if (time > 1800) set xtics 5 nomirror;
 
 # Count average-value for balance sero-line
 samples(x) = $0 > 4 ? 5 : ($0+1)
index 2c102ba501e3d6587278588f0614c5bbeef822f2..6266962be1ce32f1f9eeadb0d3dc6754e6c7693e 100644 (file)
@@ -49,15 +49,15 @@ set format x "%.0f"
 set grid y
 
 # extract the 'time' cell for xtics
-stats datafile every ::::0 using 3 nooutput
-time = int(STATS_min)
-
-if (time <= 120) set xtics 0.5 nomirror;
-if (time <= 300) set xtics 1 nomirror;
-if (time <= 900) set xtics 2 nomirror;
-if (time <= 1200) set xtics 3 nomirror;
-if (time <= 1800) set xtics 5 nomirror;
-if (time > 1800) set xtics 10 nomirror;
+stats datafile nooutput
+stats datafile u (lastdatapoint=$3) every ::STATS_records-1::STATS_records-1 nooutput
+time= int(STATS_max)
+
+#set xtics based on elapsed time
+set xtics 1 nomirror
+if (time > 300) set xtics 1 nomirror;
+if (time > 900) set xtics 2 nomirror;
+if (time > 1800) set xtics 5 nomirror;
 
 # Draw the plot based on log-plotter's variable cell-count
 if (cell_cnt==1) plot  datafile using ($3/60):(($7 > 0 ? $7 : NaN)) axes x1y1 with lines title "Cell 1", \
index 4604338237abb8cb116baf6d028b010ad6878b78..921f3d98edf0e6efb0fafad988cf99c9bb8fcc37 100644 (file)
@@ -48,15 +48,15 @@ set y2tics border
 set grid y
 
 # extract the 'time' cell for xtics
-stats datafile every ::::0 using 3 nooutput
-time = int(STATS_min)
+stats datafile nooutput
+stats datafile u (lastdatapoint=$3) every ::STATS_records-1::STATS_records-1 nooutput
+time= int(STATS_max)
 
-if (time <= 120) set xtics 0.5 nomirror;
-if (time <= 300) set xtics 1 nomirror;
-if (time <= 900) set xtics 2 nomirror;
-if (time <= 1200) set xtics 3 nomirror;
-if (time <= 1800) set xtics 5 nomirror;
-if (time > 1800) set xtics 10 nomirror;
+#set xtics based on elapsed time
+set xtics 1 nomirror
+if (time > 300) set xtics 1 nomirror;
+if (time > 900) set xtics 2 nomirror;
+if (time > 1800) set xtics 5 nomirror;
 
 # Draw the plot based on log-plotter's variable cell-count
 plot   datafile using ($3/60):($5) axes x1y1 with lines title "Voltage", \