#!/bin/sh
# demos for Grace
#

# define the location
#
if test -x ../src/xmgrace
then
	GRACE=../src/xmgrace
	GRACE_HOME=`pwd`/..
else
if test -x ../bin/xmgrace
then
        GRACE=../bin/xmgrace
	GRACE_HOME=`pwd`/..
else
	GRACE=xmgrace
fi
fi

# don't ask stupid questions :)
#
GRACE="$GRACE -noask"
#

# command line parameters
$GRACE -usage
sleep 3
#
# explain the row of single character buttons and a few other things
$GRACE explain.agr 
#
# display the various axes available
$GRACE axes.agr 
#
# display the symbols and line styles
$GRACE symslines.agr 
#
# display more symbols
$GRACE moresyms.agr 
#
# display various fill styles
$GRACE fills.dat 
#
# some graph stuff and ticks
$GRACE -p graphs.par 
#
# some graph stuff and ticks
$GRACE props.agr 
#
# demonstration of many graphs
$GRACE -maxgraph 36 manygraphs.agr
#
# some graph stuff and ticks
$GRACE brw.dat -p regions.par 
#
# test of a graph inset
$GRACE tinset.d 
#
# some time and date formats
$GRACE times.dat 
#
# some more tick label formats
$GRACE -p tforms.par 
#
# some more tick label formats
$GRACE au.d 
#
# display fonts and font mappings
$GRACE tfonts.agr 
#
# advaned typesetting
$GRACE typeset.agr
#
# example of world stack
$GRACE tstack.dat 
#
# a graph with a parameter file
$GRACE -p test1.par -a xy test.dat 
#
# a graph with a parameter file in reverse video
$GRACE -rvideo -p test1.par -a xy test.dat 
#
$GRACE test2.d 
#
# multiple graphs with a parameter file
$GRACE mlo.dat -graph 1 brw.dat -p co2.par 
#
# multiple graphs created with arrange feature
$GRACE co2.all 
#
# a graph with alternate axes
$GRACE -p altaxis.par test.dat -a xy 
#
# a graph with error bars
$GRACE terr.d 
#
# another graph with error bars
$GRACE terr2.d 
#
# a graph with XY RADIUS format
$GRACE txyr.dat 
#
# a graph with hilo data
$GRACE hilo.dat 
#
# log plots
$GRACE -p logtest.par log.d -graph 1 log.d 
#
# more log plots
$GRACE tlog.agr 
#
# non-linear curve fitting
$GRACE logistic.d 
#
# polar plots
$GRACE polar.agr
#
# bar charts
#
# display all types of bar graphs
$GRACE bars.d 
#
# a bar graph demonstrating specified ticks and tick labels
$GRACE bar.d 
#
# a bar graph demonstrating specified ticks and tick labels
$GRACE bar2.d 
#
# a bar graph demonstrating patterns
$GRACE tbar3.dat 
#
# a stacked bar graph
$GRACE stackedb.d 
#
# some interesting stuff
$GRACE -arrange 2 2 -b test.com
#
# a slideshow demo
$GRACE -pipe  < slideshow.d
#
# Test the -pipe option
$GRACE -pipe < tpipe.d
#
# need a program
# modified from previous versions, a thank you goes to Bruce Barnett
# this modification allows others without write permission
# to run the demos.
#
echo ""
if test ! -f tmc
then
      echo ""
      echo "Compiling a short program to test the -pipe option"
      echo "Executing 'cc tmc.c -o tmc -lm'"
      cc tmc.c -o tmc -lm
      echo "Done compilation"
      echo ""
fi

#
# a graph with the -pipe option
echo "Testing -pipe option, executing './tmc | $GRACE -pipe' "
./tmc | $GRACE -pipe 

rm -f tmc.o tmc

