set datafile separator ","
filename = system("echo 'hrm1.csv'")
first_timestamp = system("awk -F',' 'NR==2 {print $1}' hrm1.csv")
set xlabel 'Time (seconds)'
set ytics nomirror
set ylabel 'ppg'
plot filename using (($1 - first_timestamp) / 1000.0):7 with p title 'raw' axes x1y1
replot filename u (($1 - first_timestamp) / 1000.0):10 with l t 'offset' axes x1y1
set y2tics nomirror
set y2label 'beats'
replot filename using (($1 - first_timestamp) / 1000.0):5 with p title 'beats' axes x1y2
# Pause to keep the plot window open
pause -1
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
gnuplot -e "load 'plotscript.gnu'"
# 5 = beats
# 6 = confidence
# 7 = hrm.raw=(ppg+offset)*2
# 9 = ppg
# 10 = offset