#!/bin/sh

usage()
{
	echo "usage: [-e] file ..." 1>&2
	exit 1
}

style=lines
if [ "$1" = -e ]; then
	style=errorlines
	shift
fi

[ "$1" ] || usage

files=
while [ "$1" ]; do
	[ "$files" ] && files="$files, "
	files="$files\"$1\""
	shift
done

gnuplot -persist <<EOF
# the y range is not entirely correct - we have RSSI in [-94, -10], and 
# TX in [-17, 3], so the theoretically possible range would be [-97, 7].
set yrange [-94:-10]
set ylabel "RX-TX power (dBm)"
set xlabel "Frequency (MHz)"
set bars small
set style data $style
plot $files
EOF
