#!/bin/bash

if ! which gnuplot > /dev/null 2>&1
then
    echo 'gnuplot not found - skipping graph creation' >&2
    exit 1
fi

gnuplot<<EOF
    set terminal pngcairo color enhanced size 800,600
    set output 'alpha.png'

    set key outside below
    set grid
    set xlabel 't'
    set ylabel '{/Symbol a}'

    PATH = '../postProcessing/probes/0/'

    plot PATH.'alpha.airD1'   w l lw 3 t 'airD1', \
         PATH.'alpha.airC'    w l lw 3 t 'airC', \
         PATH.'alpha.water'   w l lw 3 t 'water', \
         'probes/alpha.airD1' w l dt 2 t 'airD1 - reference', \
         'probes/alpha.airC'  w l dt 2 t 'airC - reference', \
         'probes/alpha.water' w l dt 2 t 'water - reference'
EOF

#------------------------------------------------------------------------------
