• gnuplot -e "load 'plotscript.gnu'"

    # 5 = beats
    # 6 = confidence
    # 7 = hrm.raw=(ppg+offset)*2
    # 9 = ppg
    # 10 = offset

    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
    
About

Avatar for d3nd3-o0 @d3nd3-o0 started