# gnuplot script to assist knock_analysis.pl
# usage: gnuplot plot_knock

#set term postscript eps color
set term png


# the diff plot
set output "fknock_hist_diff.png"
set title "diff"
set xlabel "knock\_val-noise\_val"

plot 'fknock_hist_diff' index 0 using 1:2 title "igncount=0" with lines,\
	'fknock_hist_diff' index 1 using 1:2 title "igncount=1" with lines,\
	'fknock_hist_diff' index 2 using 1:2 title "igncount=2" with lines,\
	'fknock_hist_diff' index 3 using 1:2 title "igncount=3" with lines


# the ratio plot
set output "fknock_hist_ratio.png"
set title "ratio"
set xlabel "knock\_val/noise\_val"

plot 'fknock_hist_ratio' index 0 using 1:2 title "igncount=0" with lines,\
	'fknock_hist_ratio' index 1 using 1:2 title "igncount=1" with lines,\
	'fknock_hist_ratio' index 2 using 1:2 title "igncount=2" with lines,\
	'fknock_hist_ratio' index 3 using 1:2 title "igncount=3" with lines


# 3d plot showing where (f(rpm,kpa,adv)) the knocks happens
splot 'fknock_3d_map0' using 1:2:3 title "igncount=0" with points,\
	'fknock_3d_map1' using 1:2:3 title "igncount=1" with points,\
	'fknock_3d_map2' using 1:2:3 title "igncount=2" with points,\
	'fknock_3d_map3' using 1:2:3 title "igncount=3" with points

