3 # Print gnuplot output on RGIP (Uniplex) format.
5 set input_files = () # the plot input command files
6 set lpr_opts = () # options to lpr
9 # File for plot commands, and for plot output
11 set outfile="|mail $USER" #mail user if no outputfile
13 set windows = () #windows nr i x-dir and y-dir
16 # default is Imagen mode for Imagen printer; see -p option
17 set setterm="set terminal imagen"
19 set usage="usage: rgipgnu [-f fontsize] [-w [winx,winy]] [-t title] [-o outputfile] [-p 'plot command'] [plot-files....]"
21 # Loop through the command-line arguments.
29 case - : # print to stdout
35 case -f?*: # Specify font size
36 set fontsize = `echo $argv[1] | sed 's/^-f//'`)
40 case -f: # Specify font size
43 set fontsize = $argv[1]
46 echo "Usage: -f fontsize (1-8)"
47 echo "Type rgipgnu -help for help."
52 case -o?*: # Specify output-file of plot
53 set outfile = `echo $argv[1] | sed 's/^-o//'`
58 case -o: # Specify title of plot
61 set outfile = $argv[1]
65 echo "Usage: -o outputfile"
66 echo "Include a 'X' in filename if multiple plots"
67 echo "Type lasergnu -help for help."
72 case -t?*: # Specify title of plot
73 echo set title \""`echo $argv[1] | sed 's/^-t//'`"\" >> $TMP
77 case -t: # Specify title of plot
80 echo set title \""$1"\" >> $TMP
83 echo "Usage: -t title ..."
84 echo "Type lasergnu -help for help."
92 case -p?*: # plot-commds
93 echo "$argv[1]" | sed "s/^-p//" >> $TMP
97 case -p: # Set the printer, exactly as by itroff.
100 echo "$argv[1]" >> $TMP
103 echo "Usage: -P 'plot-commands ...'"
104 echo "Type rgipgnu -help for help."
109 case -w: # Specify split page
112 set windows="[$argv[1]]"
115 echo "Usage: -w no_horiz,no_vertical"
116 echo "Type lasergnu -help for help."
122 echo "I do not recognize option $argv[1]."
127 set input_files = ($input_files $argv[1])
134 set setterm="set term rgip $fontsize $windows"
137 echo "$setterm" > $TMP.plt
138 echo set output \"$outfile\" >> $TMP.plt
139 if (-e $TMP) cat $TMP >> $TMP.plt
141 # If input file is specified AND command line contains plot commands, then
142 # do command line args first, then plot commands in input file.
143 #if ( "$input_files" != "" ) then
145 grep -v "set te" $input_files | grep -v "set out" >> $TMP.plt
147 grep -v "set te" $input_files >> $TMP.plt
149 echo "quit" >> $TMP.plt
150 gnuplot $TMP.plt < /dev/null