# Terminal settings
#set terminal pngcairo size 1000,600 enhanced font 'Verdana,18'
#set output "plot.png"
#set border lw 1.5

# Set labels
set xlabel "Time (ns)"
set ylabel "Coefficients (kJ/mol)"

# Set plot range and tic options
set yr [-30:45]

# Define colors
set style line 1 lt 1 lw 3 lc rgb "#e41a1c"
set style line 12 lt 2 lw 1 lc rgb "#e41a1c"
set style line 2 lt 1 lw 3 lc rgb "#377eb8"
set style line 22 lt 2 lw 1 lc rgb "#377eb8"
set style line 3 lt 1 lw 3 lc rgb "#4daf4a"
set style line 32 lt 2 lw 1 lc rgb "#4daf4a"
set style line 4 lt 1 lw 3 lc rgb "#984ea3"
set style line 42 lt 2 lw 1 lc rgb "#984ea3"
set style line 5 lt 1 lw 3 lc rgb "#ff7f00"
set style line 52 lt 2 lw 1 lc rgb "#ff7f00"
set style line 6 lt 1 lw 3 lc rgb "#ffff33"
set style line 62 lt 1 lw 1 lc rgb "#ffff33"
set style line 7 lt 1 lw 3 lc rgb "#a65628"

set key bottom left horizontal

coeffs_stride=10
ns_per_iteration=0.001

pl "< awk '$1==1 {print $2}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 1 title "Coeff 1", \
   "< awk '$1==1 {print $3}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 12 notitle, \
   "< awk '$1==2 {print $2}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 2 title "Coeff 2", \
   "< awk '$1==2 {print $3}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 22 notitle, \
   "< awk '$1==3 {print $2}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 3 title "Coeff 3", \
   "< awk '$1==3 {print $3}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 32 notitle, \
   "< awk '$1==4 {print $2}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 4 title "Coeff 4", \
   "< awk '$1==4 {print $3}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 42 notitle, \
   "< awk '$1==5 {print $2}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 5 title "Coeff 5", \
   "< awk '$1==5 {print $3}' coeffs.data" u ($0*coeffs_stride*ns_per_iteration):1 w l ls 52 notitle
pause -1
