#!/bin/sh ####################################################################### # Tom Laramee - ECE 671, Homework 3 # # Script to automate the generation of the GNU plot plots for # my p5 simulation. # # It generates the 2 plot-creation files which are used by Gnu Plot # to generate .ps output. This simply echos the correct parameters # to the 2 plot files....which the "sim" script will later use # to generate the data ####################################################################### file1=data2.plot1 # the names of the files which will be generated file2=data2.plot2 # by this script op1=$1 # data files which will be eventuallty plotted op2=$2 nodes=$5 # the number of nodes prob=$6 # the prob of unsuccessful transmission # ---------------------------------------------------- Message info echo sim.gnuplot.sh: echo sim.gnuplot.sh: Gnuplot driver file: $file1 echo sim.gnuplot.sh: Gnuplot data file: $op1 echo sim.gnuplot.sh: Gnuplot .ps plot: $file1.ps echo sim.gnuplot.sh: # ------------------------------------------------------ generate file 1 rm -f $file1 touch $file1 echo "set terminal postscript landscape \"helvetica\" 20" >> $file1 echo "set output \"data2.plot1.ps\" " >> $file1 echo "set format xy \"%g\" " >> $file1 echo "set xlabel \"Channel length \" " >> $file1 echo "set ylabel \"Channel Utilization\" " >> $file1 echo "set yrange [0:1]" >> $file1 echo "set title \"Channel Utilization vs. Cable length (in frames) (W=7) - for varying P1 \" " >> $file1 echo "set key" >> $file1 echo "plot \"$op1\" using \"%f%f\" t 'P1=0.2' with lines, \"$op1\" using \"%f%*f%f\" t 'P1=0.4' with lines, \"$op1\" using \"%f%*f%*f%f\" t 'P1=0.8' with lines " >> $file1 # ------------------------------------------------------- Message info echo sim.gnuplot.sh: Gnuplot driver file: $file2 echo sim.gnuplot.sh: Gnuplot data file: $op2 echo sim.gnuplot.sh: Gnuplot .ps plot: $file2.ps echo sim.gnuplot.sh: # ------------------------------------------------------ generate file 2 rm -f $file2 touch $file2 echo "set terminal postscript landscape \"helvetica\" 20 " >> $file2 echo "set output \"data2.plot2.ps\" " >> $file2 echo "set format xy \"%g\" " >> $file2 echo "set xlabel \"Window Size\" " >> $file2 echo "set ylabel \"Channel Utilization\" " >> $file2 echo "set yrange [0:1]" >> $file2 echo "set title \"Channel Utilization vs Window Size (l=3) - for varying P1 \" " >> $file2 echo "set key" >> $file2 echo "plot \"$op2\" using \"%f%f\" t 'P1=0.2' with lines, \"$op2\" using \"%f%*f%f\" t 'P1=0.4' with lines, \"$op2\" using \"%f%*f%*f%f\" t 'P1=0.8' with lines " >> $file2