#! /bin/sh
# 
# File:   PlotEnergy.sh
# Author: ous
#
# Created on December 15, 2007, 12:59 AM
#

file=$1/STAR.csv
n=${n=4}

sub() {
	n=$1
	shift
	title="$*"
	cut -d, -f $n $file|  sed '1d' > /tmp/$$.dat
	gnuplot<<EOF
		set title "$title"
		set nokey
                set log y
		set terminal png
		set output "$title.png"
		plot "/tmp/$$.dat"
EOF
}

sub 41 Energy