# Plotting the Spectrum
# $theTab = Sequence Number
# $1 = SpType
######################################

#################################################################
# Vgraph not defined ==> just the text for the plot
# Take the caption from the ReadMe file !
#################################################################
if (! $?Vgraph) then
    set text = `fgrep "starN$theTab " ReadMe | sed 's/^.* E/E/'`
    echo1 "\section*{$text}"
    #echo "\section{Energy Distribution for star \#{\fg{red3}\#$theTab}}"
    cgigraph -img -ps:"Postscript Figure" -txt:"Data as a Table" -form -htx \
	-graph $argv:q
    exit 0
endif

################################################################
# Actual gif or ps plot (Vgraph contains gif or plot)  $1=m or c
################################################################

set  plotarg =  \
   "-f 0.0325 -h 0.75 -w 0.75 -u 0.125 -r 0.15 --title-font-size 0.05"


(echo "-source=$theCat/table2"; echo "-out=lambda,#$theTab+1") \
| asu -data | graph -T $Vgraph -C $plotarg -L "Energy Distribution" \
   -X '\*l[nm]' -Y 'Flux [nW/m\sp2\ep/cm]' $argv:q
#    --pen-colors 1=red:2=red3:3=green -m -1 -S 3 $argv:q
