#! /bin/bash
# Last edited on 2023-11-29 11:16:39 by stolfi

show="$1"; shift            # "SHOW" to display, or "NOSHOW".
fname="$1"; shift           # Run filename sans ".txt". 
ic_ini=$(( 10#$1 )); shift  # First electrode to plot (from 0).
ic_fin=$(( 10#$1 )); shift  # Last electrode to plot (from 0).
vmax=$1; shift              # Maximum abs data value, for Y scaling purposes.

if [[ ! ( -s "${fname}.txt" ) ]]; then
  echo "** file \"${fname}.txt\" not found" 1>&2 ; exit 1
fi
    
# set -o xtrace

echo "plotting ${fname}.txt --> ${fname}.png" 1>&2
rm -f ${fname}.png

nmeeg_plot_channels.sh \
  ${show} \
  ${fname} \
  0 ${vmax} \
  ${ic_ini} ${ic_fin} \
  0 0 \
  1400 500

