home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume10 / crc_plot / part03 < prev    next >
Internet Message Format  |  1987-07-07  |  47KB

  1. Path: uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i047:  CRC Plotting Package, Part03/06
  5. Message-ID: <606@uunet.UU.NET>
  6. Date: 9 Jul 87 01:14:27 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 2020
  9. Approved: rs@uunet.UU.NET
  10.  
  11. Submitted-by: "Wombat" <rsk@j.cc.purdue.edu>
  12. Posting-Number: Volume 10, Issue 47
  13. Archive-name: crc_plot/Part03
  14.  
  15.  
  16.  
  17. #    This is a shell archive.
  18. #    Remove everything above and including the cut line.
  19. #    Then run the rest of the file through sh.
  20. #----cut here-----cut here-----cut here-----cut here----#
  21. #!/bin/sh
  22. # shar:    Shell Archiver
  23. #    Run the following text with /bin/sh to create:
  24. #    doc
  25. mkdir doc
  26. chdir doc
  27. cat << \SHAR_EOF > alpha.3g
  28. .TH ALPHA 3g "CRC Graphics Package"
  29. .SH NAME
  30. alpha - Return Tektronix to alpha-numeric mode
  31. .SH SYNOPSIS
  32. .nf
  33. >From C:
  34.     alpha()
  35.     
  36. >From F77:
  37.     call alpha
  38. .fi
  39. .SH DESCRIPTION
  40. The software leaves the Tektronix in the plot state after
  41. each subrotuine call. 
  42. If the user writes to the terminal
  43. without a proceeding the write with a call to 
  44. .I alpha,
  45. the Tektronix will think that the alpha-numeric data
  46. from the user is valid plot information.
  47. Garbage graphics will result.
  48. .PP
  49. The terminal remains in an alpha-numeric state until
  50. the next graphics call.
  51. .PP
  52. A call to 
  53. .I alpha
  54. when plotting
  55. on the HP plotter will cause the software
  56. to flush its internal output buffers.
  57. This allows for pseudo interactive plotting
  58. on the HP plotter.
  59. SHAR_EOF
  60. cat << \SHAR_EOF > axis.3g
  61. .TH AXIS 3g "CRC Graphics Package"
  62. .SH NAME
  63. axis - Draw axis
  64. .SH SYNOPSIS
  65. .nf
  66. >From C:
  67.     float   x,y,size,min,max;
  68.     int     xy,flag;
  69.     char    *label;
  70.  
  71.     axis(x,y,label,xy,size,min,max,flag);
  72.     
  73. >From F77:
  74.     real    x,y,size,min,max,
  75.     integer xy,flag
  76.     character label()
  77.  
  78.     call axis(x,y,label,xy,size,min,max,flag)
  79. .fi
  80. .SH DESCRIPTION
  81. To draw a labeled coordinate axis with numerically annotated
  82. tic-marks at one unit intervals.
  83. .PP
  84. The following parameters are used to specify the details of the axis.
  85. .TP 14
  86. x, y
  87. the coordinates (in plot units) of the starting point
  88. of the axis.
  89. .TP
  90. label
  91. a pointer to a zero terminated string which is to be used
  92. as an axis label.
  93. .TP
  94. xy
  95. One of the following four values indicate the direction and
  96. orientation of the axis.
  97. .br
  98. 0: plot axis at zero degrees, tic marks below the axis.
  99. .br
  100. 1: plot axis at ninety degrees, tic marks left of the axis.
  101. .br
  102. 2: plot axis at zero degrees, tic marks above the axis.
  103. .br
  104. 3: plot axis at ninety degrees, tic marks right of the axis.
  105. .TP
  106. size
  107. the length (in plot units) of the coordinate axis.
  108. .TP
  109. min
  110. the numerical value corresponding to the first tic-mark
  111. of the axis (at the point (x,y)), usually the same
  112. as the value computed by 'scale'.
  113. .TP
  114. max
  115. The numerical value corresponding to the last tic-mark of
  116. the axis.
  117. .TP
  118. flag
  119. if flag is positive, the numerical values calculated for
  120. the tic-marks will be truncated to form integers.
  121. If flag is zero, the annotations will be floating point.
  122. If flag is negative, no numerical annotation will be done.
  123. .SH REMARKS
  124. The distance between tic-marks can be changed by setting
  125. the variable 
  126. .I ticdis
  127. to the desired distance using subroutine 
  128. .I axisv.
  129. Ticdis will be adjusted so that it is an integer divisor
  130. of size. 
  131. If ticdis is too small, the annotations at the tic-marks
  132. will run over each other.
  133. .PP
  134. When integer annotations are desired, (
  135. .I max - min
  136. ) should be
  137. divisible by (
  138. .I size / ticdis
  139. ) to prevent truncation errors.
  140. .PP
  141. When the tic numerical values become very small or very large (in
  142. absolute value), the values will be converted into  base ten
  143. mantissa and characteristic notation with the characteristic
  144. appended to the label.
  145. .PP
  146. The axis itself starts at (x,y) and all the labeling appears
  147. below, next to, or above it. Be sure to allow space for
  148. the labeling.
  149. .PP
  150. The number of significant digits used in the annotations can
  151. be changed by setting the variable 
  152. .I digits 
  153. to the number
  154. of digits desired using the 
  155. .I axisv
  156. subroutine.
  157. SHAR_EOF
  158. cat << \SHAR_EOF > axisv.3g
  159. .TH AXISV 3g "CRC Graphics Package"
  160. .SH NAME
  161. axisv - change parameters of axis
  162. .SH SYNOPSIS
  163. .nf
  164. >From C:
  165.     float    ticdis;
  166.     int    digits;
  167.  
  168.     axisv(ticdis,digits);
  169.     
  170. >From F77:
  171.     real    ticdis
  172.     integer digits
  173.  
  174.     call axisv(ticdis,digits)
  175. .fi
  176. .SH DESCRIPTION
  177. To change the default distance between axis tic marks and the number
  178. of significant digits in the numerical annotations.
  179. The parameters are as follows
  180. .TP 10
  181. ticdis
  182. the distance (in plot units) between tic-marks on the axis.
  183. .TP
  184. digits
  185. the number of significant digits in the numerical annotation
  186. .SH REMARKS
  187. The default values for ticdis and digits are 1.0 and 6, respectively.
  188. .PP
  189. The values will be in effect until the next call to 
  190. .I axisv
  191. for all
  192. subsequent calls to 
  193. .I axis
  194. and 
  195. .I laxis.
  196. .PP
  197. The 
  198. .I axis
  199. subroutine will modify 
  200. .I ticdis
  201. so that
  202. the length of the axis divided by 
  203. .I ticdis
  204. is
  205. an integer.
  206. .SH SEE ALSO
  207. axis(3g),
  208. laxis(3g)
  209. SHAR_EOF
  210. cat << \SHAR_EOF > crclabel.1g
  211. .TH CRCLABEL 1 "CRC Graphics"
  212. .SH NAME
  213. crclabel - Label a CRC plot
  214. .SH SYNOPSIS
  215. crclabel [arguments]
  216. .SH DESCRIPTION
  217. .B Crclabel
  218. is used to add additional labels to a CRC plot.
  219. The 
  220. .I xp
  221. and 
  222. .I yp
  223. parameters are used to set the location of the
  224. text specified by the 
  225. .I tl
  226. option.
  227. .I Qplot(1)
  228. style arguements are used to specify the device where the text
  229. is to be written.
  230. .PP
  231. .B Crcplot
  232. generates a plot on
  233. the default Printronix line printer as defined in
  234. .B gplp 
  235. (1).
  236. If ARPA is the host machine, the output will appear on
  237. the Comtal graphics overlay bit-plane zero.
  238. .PP
  239. The following options are
  240. available to modify the graph:
  241.  
  242. **** POSITIONING AND REDUCING OPTIONS ****
  243. .TP 14
  244. xp=r
  245. The x starting coordinate of the text is moved to
  246. position r.
  247. The default value of r is zero.
  248. .TP 14
  249. yp=r
  250. Same as the `xp=r' flag but the y origin of the text is moved to r.
  251. .TP 14
  252. scfac=r
  253. The graph is expanded or reduced in size by r.
  254. The
  255. default value is 1.0.
  256.  
  257. .RS 0
  258. **** DEVICE SELECTION OPTIONS ****
  259. .TP 14
  260. -c
  261. The plot is displayed on a Comtal image instead of a
  262. graphic overlay.
  263. The image that is currently being
  264. displayed is used unless the -n flag is used.
  265. .TP 14
  266. -g
  267. Display the plot on a Comtal graphic overlay.
  268. This flag
  269. is set by default if ARPA is the host machine.
  270. The
  271. Comtal is connected to the ARPA machine.
  272. .TP 14
  273. -n
  274. The plot is displayed on the Comtal's graphic overlay n
  275. or Comtal image n.
  276. N can be either 0,1, or 2.
  277. .TP 14
  278. -G
  279. Display the plot on the Grinnel connected to the ARPA
  280. machine.
  281. .TP 14
  282. -t
  283. Display the plot on a Tektronix 4010 or 4014 display.
  284. Standard output must end up on the specified terminal.
  285. .TP 14
  286. -T
  287. Display the plot on a Retro-Graphics RG-512  in
  288. conjunction with an ADM-3A terminal.
  289. .TP 14
  290. -h
  291. Display the plot on an HP plotter.
  292. .TP 14
  293. pen=n
  294. When using the HP plotter, the pen in bin n is used to
  295. plot the graph.
  296. The default bin is 1.
  297. This invokes the `-h' flag.
  298. .TP 14
  299. speed=n
  300. The HP plotter's pen movement velocity will be changed
  301. to `n' cm/sec.
  302. The valid range for n is [1,36].
  303. The
  304. default value is 36.
  305. This option will invoke the `-h'
  306. flag.
  307. .TP 14
  308. -p
  309. The plot is sent to the Printronix line printer through
  310. .B gplp
  311. (1).
  312. This is the default output option for all
  313. host machines except for ARPA.
  314. See 
  315. .B gplp
  316. (1) to
  317. determine to which network line printer the output
  318. will be sent.
  319. .TP 14
  320. site=XX
  321. The output is sent to the network line printer
  322. specified by XX.
  323. See 
  324. .B opr 
  325. (1) for more information
  326. about the allowable printer names.
  327. This option invokes
  328. the `-p' flag.
  329. .TP 14
  330. -v
  331. The plot is sent to the alternate Versatec through a
  332. pipe to gp (1).
  333. .TP 14
  334. -o
  335. The graph is written out to standard output.
  336. .TP 14
  337. g=file
  338. The graph is written out to a file named `file'.
  339. This
  340. file can be sent to the Versatec or Printronix with 
  341. .B gp
  342. (1) and 
  343. .B gplp
  344. (1), respectively.
  345. .TP 14
  346. op=str
  347. The string is appended to the call to 
  348. .B gplp, gp, hpd, 
  349. and 
  350. .B gd.
  351. This provides a method to change any of
  352. the options to the driver programs.
  353. .TP 14
  354. -b
  355. The display device is not blanked before plotting.
  356. This
  357. option has no effect when used with the `h', `v', `V',
  358. and `p' flags.
  359. If the `g=file' option is used 
  360. and `file' exists in the local directory before plotting
  361. begins, then the new graphics will overlay the graphics
  362. contained in `file'.
  363. .TP 14
  364. -B
  365. Turn off the -b flag.
  366. This option is set by default.
  367.  
  368. .RS 0
  369. **** LABEL OPTIONS ****
  370. .TP 14
  371. tl=str
  372. The string will be used as a label.
  373. The string will be placed at the position on the screen indicated
  374. by the 
  375. .I xp
  376. and 
  377. .I yp
  378. parameters.
  379. .PP
  380. The parse routines internal to 
  381. .B crclabel
  382. allow for two default
  383. mechanisms to specify options.
  384. The first method is to create a
  385. file `.crclabelrc' in your HOME directory (see environ (5)).
  386. In it,
  387. one can place options and flags that 
  388. .B crclabel
  389. will use before it
  390. parses your command line.
  391. The syntax is one command or flag
  392. string per line.
  393. .PP
  394. As an example, consider the case where the user wishes to
  395. always obtain output on the Versatec.
  396. The correct format for
  397. the file `.crclabelrc' would be:
  398. .RS 1i
  399.  -v
  400. .RE
  401. .PP
  402. The second method to set default options is to set the
  403. environment variable `CRCLABELARGS'. The format of `CRCLABELARGS' is the
  404. same as the input command line.
  405. .PP
  406. The options set in the previous example can be set using the
  407. following procedure:
  408. .PP
  409. For /bin/sh:
  410.     $CRCLABELARGS='-v'
  411.     $export CRCLABELARGS
  412. .PP
  413. For /bin/csh
  414.     $setenv CRCLABELARGS '-v'
  415. .PP
  416. .B crclabel
  417. will parse the file `.crclabel' first, if it exists.
  418. Then
  419. it will parse `CRCLABELARGS', if it exists. 
  420. Finally, 
  421. .B crclabel
  422. will parse
  423. the command line.
  424. .SH SEE ALSO:
  425. graphics/crc
  426. qplot(1)
  427. .SH AUTHOR
  428. Hacked together by Malcolm
  429. .SH FILES
  430. .TP 14
  431. /etc/cpu
  432. Contains name of host
  433. .SH BINARIES
  434. This program has not been installed on the system.  
  435. Currently it resides in "~malcolm/bin/crclabel" on the 
  436. EC, ED, EE, EF and EG Vax computers.
  437. .SH SUPPORT
  438. This was a quick hack by Malcolm and will be supported on a time
  439. available basis by the author.
  440. All of the code was stolen directly from 
  441. .I qplot.
  442. SHAR_EOF
  443. cat << \SHAR_EOF > dline.3g
  444. .TH DLINE 3g "CRC Graphics Package"
  445. .SH NAME
  446. dline - draw a parametric line
  447. .SH SYNOPSIS
  448. .nf
  449. >From C:
  450.     float   *x,*y,*dsh,*gap,lx,ly;
  451.     int     n,m;
  452.  
  453.     dline(x,y,n,dsh,gap,m,lx,ly);
  454.     
  455. >From F77:
  456.     real    x(),y(),dsh(),gap(),lx,ly
  457.     integer n,m
  458.  
  459.     call dline(x,y,n,dsh,gap,m,lx,ly)
  460. .fi
  461. .SH DESCRIPTION
  462. To draw a plot of a parametric relationship (x[i],y[i]),
  463. i=0,2,...,n-1, with a dashed line.
  464. The 
  465. .I i=n'th
  466. and
  467. .I i=n+1'th
  468. elements of each array should represent the minimum and maximum values
  469. of the points in that vector.
  470. The user can call the routine
  471. .I scale(3g)
  472. to automatically find the minimum and maximum values.
  473. All data values are scaled to these values.
  474. .PP
  475. The following parameters are used to specify the line.
  476. .TP
  477. x,y
  478. pointers to arrays containing the x and y coordinates of a
  479. parametric relationship (x[i],y[i]).
  480. .TP
  481. n
  482. the number of points (x[i],y[i]) in the parametric relationship.
  483. .TP
  484. dsh
  485. a pointer to an array of length m containing the lengths of
  486. the sequence of dashes to be used in plotting the relationship.
  487. .TP
  488. gap
  489. a pointer to an array of length m containing the lengths of
  490. the sequence of  spaces between dashes to be used in plotting the relationship.
  491. .TP
  492. m
  493. the number of dashes and gaps in the dash-gap sequence.
  494. .TP
  495. lx
  496. the length (in plot units) that (xmax - xmin) is mapped to in page
  497. coordinates.
  498. Should be the same value used in the axis subroutine.
  499. .TP
  500. ly
  501. the length (in plot units) that (ymax - ymin) is mapped to in 
  502. page coordinates. Should be the value used in the axis subroutine.
  503. .SH REMARKS
  504. Arbitrarily complex dash-gap sequences may be specified. 
  505. Dshline
  506. first plots a dash of length dsh[0], then a gap of length
  507. gap[0], then a dash of length dsh[1], etc. After plotting
  508. gap[m-1], the sequence is repeated starting again with dsh[0].
  509. .PP
  510. If 
  511. .I m = 0, dsh 
  512. and 
  513. .I gap 
  514. are ignored and the curve is plotted as
  515. a solid line curve with subroutine 
  516. .I line.
  517. .PP
  518. The arrays pointed to by 
  519. .I x
  520. and 
  521. .I y 
  522. must be dimensioned at least
  523. .I n+2,
  524. and the minimum and maximum values of each
  525. array must be stored in the 
  526. .I n+1st
  527. and 
  528. .I n+2nd
  529. array positions
  530. respectively.
  531. .PP
  532. An error will occur if xmin = xmax or ymin = ymax.
  533. SHAR_EOF
  534. cat << \SHAR_EOF > examples.8g
  535. .TH EXAMPLES 8g "CRC Graphics Package"
  536. .SH NAME
  537. examples - several examples using the CRC Grapics Package
  538. .SH "EXAMPLE 1"
  539. The first example will demonstrate the use of Qplot using
  540. the output from a FORTRAN program compiled with `f77'.
  541. Consider the following program:
  542. .nf
  543.  
  544.     real y1(100),y2(100),x(100),y3(100)
  545.     open(unit=2,file='y1',status='new',form='unformatted')
  546.     open(unit=3,file='y2',status='new',form='unformatted')
  547.     open(unit=7,file='y3',status='new',form='unformatted')
  548.     open(unit=4,file='x',status='new',form='unformatted')
  549.     do 10 i=1,100
  550.     x(i) = (i - 1) * 2.0 * 3.14159 / 99.
  551.     y1(i) = sin(x(i))
  552.     y2(i) = cos(x(i)) * 2.0
  553.     if(i .lt. 50)then
  554.         y3(i) = i
  555.     else
  556.         y3(i) = 100 - i
  557.     end if
  558. 10    continue
  559.     write(2)y1
  560.     write(3)y2
  561.     write(7)y3
  562.     write(4)x
  563.     end
  564.  
  565. .fi
  566. .ti +5
  567. If the program is in a file `test.f', it should be compiled with:
  568. .nf
  569.  
  570.     $f77. test.f
  571.  
  572. .fi
  573. .ti +5
  574. Execute the program with:
  575. .nf
  576.  
  577.     $a.out
  578.  
  579. .fi
  580. .PP
  581. The program will generate four binary files in F77 binary format.
  582. The file `y1' will contain a sine wave. `y2' will have a
  583. cosine in it. The file `y3' will have a ramp in it. The last
  584. file, `x', will contain the points in which the sine and cosine
  585. were generated from. To convert the f77 binary format to standard
  586. UNIX binary, the following commands should be run:
  587. .nf
  588.  
  589.     $strip7 y1 y2 y3 x
  590.  
  591. .fi
  592. .PP
  593. The following Qplot/Gplp sequence will plot the three
  594. curves on the Printronix line printer:
  595. .nf
  596.  
  597. $qplot y=y1 x=x,4 digits=3 ylen=3.0  'xl=sin($wt)' g=g1
  598. $qplot y=y2 x=,4 digits=3 ylen=3.0 xlen=3.0 yp=4.5 \\
  599.     'yl=cos($wt)' xl=t g=g2
  600. $qplot y=y3 xmin=-1.0 xmax=1.0 len=3.0 yp=4.5 xp=5.0 digits=3 -r \\
  601.     xtic=1.5 "xl=ramp function" g=g3
  602. $gplp g1 g2 g3
  603. $rm g1 g2 g3
  604.  
  605. .fi
  606. .PP
  607. The output generated is listed on the following page.
  608. .bp
  609. .sp 6
  610. .ce
  611. Output from example 1
  612. .bp
  613. .SH "EXAMPLE 2"
  614. .PP
  615. This example demonstrates a simple user generated graphics
  616. program in FORTRAN.
  617. Consider the following program which writes it output on the HP plotter:
  618. .nf
  619.  
  620.     call plots(7,0)
  621.     call plot(1.0,1.0,-3)
  622.     call plot(8.0,0.0,2)
  623.     call plot(8.0,8.0,1)
  624.     call plot(0.0,8.0,1)
  625.     call plot(0.0,0.0,1)
  626.     call symbol(.5,4.0,.3,"graphics",0.0)
  627.     call plot(0.0,0.0,999)
  628.     end
  629.  
  630. .fi
  631. .PP
  632. This program will plot a box with the word 'graphics'
  633. in the middle of it.
  634. It should be compiled with:
  635. .nf
  636.  
  637.     $f77 prog.f -i -lG
  638.  
  639. .fi
  640. .PP
  641. To obtain the output use:
  642. .nf
  643.  
  644.     $a.out 
  645.  
  646. .fi
  647. The output generated is:
  648. .bp
  649. .SH "EXAMPLE 3"
  650. .PP
  651. This example will present a more complicated graphics program
  652. written in C.
  653. Consider the following program written in C:
  654. .nf 
  655.  
  656. #include    <math.h>
  657.  
  658. main(){
  659.     int    i;
  660.     float    x[631],y[631];
  661.  
  662.     plots(69,0,"ver");
  663.  
  664.     for(i=0;i<630;i++){    /* compute data */
  665.         x[i] = cos(3.0 * i / 100) + 1.0;
  666.         y[i] = sin(4.0 * i / 100);
  667.     }
  668.  
  669.     scale(y,629);    /* get scaling information */
  670.     scale(x,629);
  671.  
  672.     plot(1.5,1.0,-3); /* move origin away from corner */
  673.     axisv(2.0,3); /* change default ticdis and digits */
  674.     axis(0.,0.,"x axis",0,8.,x[629],x[630],0);
  675.     axis(0.,0.,"y axis",1,8.,y[629],y[630],0);
  676.     plot(0.0,8.0,3);    /* draw border */
  677.     plot(8.0,8.0,2);
  678.     plot(8.0,0.0,2);
  679.     symbol(2.5,8.5,.2,"lissajous figure",0.0);
  680.     line(x,y,629,0,8.0,8.0);
  681.  
  682.     plot(0.0,0.0,999);    /* terminate plotting */
  683. }
  684.  
  685. .fi
  686. .PP
  687. This should be compiled with:
  688. .nf
  689.  
  690.     $cc. prog.c -i -lG -lm
  691.  
  692. .fi
  693. .PP
  694. To get the
  695. output on the Versatec, use:
  696. .nf
  697.  
  698.     $a.out 
  699.  
  700. .fi
  701. .PP
  702. The graphics output is listed on the following page.
  703. .bp
  704. .sp 5
  705. .ce
  706. Output from example 3
  707. SHAR_EOF
  708. cat << \SHAR_EOF > factor.3g
  709. .TH FACTOR 3g "CRC Graphics Package"
  710. .SH NAME
  711. factor - change scale factor
  712. .SH SYNOPSIS
  713. .nf
  714. >From C:
  715.     float   sf;
  716.  
  717.     factor(sf);
  718.     
  719. >From F77:
  720.     real    sf
  721.  
  722.     call factor(sf)
  723. .fi
  724. .SH DESCRIPTION
  725. To provide for changing the scale factor, initially 1.0, for
  726. subsequent x and y coordinates.
  727. The 
  728. .I sf
  729. parameters is
  730. the new scale factor to be used in scaling all subsequent
  731. x and y coordinates unless and until factor is called again.
  732. All plotting is scaled by this factor thus the user coordinates
  733. (x,y) are scaled to the point (sf*x,sf*y).
  734. SHAR_EOF
  735. cat << \SHAR_EOF > fname.3g
  736. .TH FNAME 3g "CRC Graphics Package"
  737. .SH NAME
  738. fname - change default file name
  739. .SH SYNOPSIS
  740. .nf
  741. >From C:
  742.     char *name;
  743.  
  744.     fname(name);
  745.     
  746. >From F77:
  747.     character name()
  748.  
  749.     call fname(name)
  750. .fi
  751. .SH DESCRIPTION
  752. To change the default file name when the plots (3g) device is 0.
  753. The parameter
  754. .I name
  755. is a pointer to a zero terminated string containing the name of the file that
  756. the final graphics output will be written.
  757. If the name is "-", then the graphics output will be written out
  758. to standard output. 
  759. .SH REMARKS
  760. .I Fname
  761. should be called before the call to 
  762. .I plots.
  763. SHAR_EOF
  764. cat << \SHAR_EOF > fontinfo.8g
  765. .TH FONTINFO 8g "CRC Graphics Package"
  766. .SH NAME
  767. Character Font Information
  768. .SH DESCRIPTION
  769. The graphics package draws all of its own symbols. 
  770. This allows the user great flexibility in the size and type of characters.
  771. The default character set is shown as an ADM-3A keyboard on the
  772. next page.
  773. The left hand side of each key is the character you would
  774. normally see. If the character on the left is preceded by a `$'
  775. then the character on the right is displayed.
  776. (Online a list follows. The first column is the normal character
  777. set and the second column is the alternate font.)
  778. .PP
  779. The `open sup' and `open sub' characters cause an effective
  780. half line shift up and down, respectively. The `close sup'
  781. and `close sub' negate the effects of the respective `open' commands.
  782. The `bs' character will back up one character. This allows for 
  783. over-written characters. The `$:' character is a combination
  784. of a `bs' and an overbar
  785. and the `$;' character is a combination of a `bs' and an underbar.
  786. .PP
  787. The `$1' through `$0', `$,', `$*', and `$+' characters are all
  788. on-center symbols used for marking points in space.
  789. The rest of the characters assume that the lower left hand corner
  790. is the start of the character.
  791. .PP
  792. The actual character descriptions are the file:
  793. .nf
  794.  
  795. /usr/lib/graphics/font.5x7.
  796. .fi
  797. .sp
  798. The routine 
  799. .I symbol (3g)
  800. defaults to this file. The user can supply his/her own font file
  801. by using the `fontint' subroutine call.
  802. .PP
  803. A program called 
  804. .I genfont
  805. is available
  806. to generate the font file from a set of ascii vector coordinates.
  807. .bp
  808. FONT CORRESPONDENCE
  809. .nf
  810.  
  811. a alpha                    ; underscore
  812. A ALPHA                    + center +
  813. b beta                    @ @
  814. B BETA                    ` `
  815. c xi                    \\ \\
  816. C XI                    | integral
  817. d delta                    _ backspace
  818. D DELTA                    , center + bs o
  819. e epsilon                < <=
  820. E EPSILON                . bold .
  821. f phi                    > >=
  822. F PHI                    / divide
  823. g gamma                    ? ?
  824. G GAMMA                    1 center ' bs O
  825. h eta                    2 center DELTA bs '
  826. H ETA                    3 center Y
  827. i iota                    4 center X
  828. I IOTA                    5 center diamond bs '
  829. j sigma                    6 center up arrow
  830. J SIGMA                    7 center X over/under bar
  831. k kappa                    8 center Z
  832. K KAPPA                    9 center X bs o
  833. l lambda                0 center box bs '
  834. L LAMBDA                : overbar
  835. m mu                    * center *
  836. M MU                    - +-
  837. n nu                    = equivalent
  838. N NU                    [ half space down
  839. o omicron                { half space up
  840. O OMICRON                ] half space up
  841. p pi                    } half space down
  842. P PI                    ^ angstrom
  843. q theta                    ~ infinity
  844. Q THETA                    ! sqrt
  845. r rho                    " "
  846. R RHO                    # approx
  847. s sigma                    $ $
  848. S SIGMA                    % not equal
  849. t tau                    & mho
  850. T TAU                    ' degree
  851. u upsilon                ( (
  852. U UPSILON                ) )
  853. v partial
  854. V gradient
  855. w omega
  856. W OMEGA
  857. x chi
  858. X CHI
  859. y psi
  860. Y PSI
  861. z zeta
  862. Z ZETA
  863. .fi
  864. SHAR_EOF
  865. cat << \SHAR_EOF > gd.1g
  866. .TH GD 1g "CRC Graphics Package"
  867. .SH NAME
  868. gd - Image Processing Graphics Driver
  869. .SH SYNOPSIS
  870. gd [-bcGio0123] [-mHOST] [if=stdin] 
  871. .SH DESCRIPTION
  872. .I
  873. Gd 
  874. is an interface program between the output of the
  875. plotting subroutines and an image display device.
  876. Currently, 
  877. .I gd 
  878. supports Comtal and Grinnell image displays or
  879. graphics overlays.
  880. .PP
  881. The file:
  882. .sp
  883.     /usr/lib/graphics/gd.site
  884. .sp
  885. contains information about which network machine
  886. has these devices. 
  887. The file contains `local'
  888. if there are devices connected locally or the
  889. name of the HOST that does have the display devices.
  890. If 
  891. .I gd
  892. can not run locally, then the graphics
  893. information is sent to:
  894. .sp
  895.     HOST!/usr/lib/graphics/gd [-Gcio0123]
  896. .sp
  897. where HOST comes from either the file `gd.site' or from
  898. the option `-mHOST'. The mode is determined
  899. by the options the local Gd is invoked with.
  900. .PP
  901. If the 
  902. .I -b
  903. flag is used the device is not cleared (blanked) before the graphical data
  904. is written on the screen.
  905. The 
  906. .I if=file
  907. parameter specifies that 
  908. the graphics information should be read from `file'. 
  909. The
  910. default input mode is standard input.
  911. .PP
  912. The device to write on is determined by a combination of the
  913. default action and the flags specified on the command line.
  914. The default action is to write the image on the Comtal Graphics
  915. Overlay number 0.
  916. In addition
  917. on the Comtal it is possible to determine the current image number
  918. being displayed so when writing to a Comtal image plane (-ci) the
  919. default action is to write to that image.
  920. These actions can be modified by using the following options.
  921. .TP 10
  922. -c
  923. Write the data on the Comtal instead of the Grinnell.
  924. .TP
  925. -G
  926. Write the data on the Grinnell instead of the Comtal.
  927. .TP
  928. -g
  929. Write the data to a graphics overlay instead of an image plane.
  930. .TP
  931. -i
  932. Write the data to an image plane instead of a graphics overlay.
  933. .TP
  934. -[n]
  935. Write on either the image plane or graphics overlay labelled 
  936. .I n.
  937. The digit
  938. .I n
  939. can be either 0, 1, 2 or 3.
  940. (Note that not all of the image processing hardware is configured
  941. with all 4 planes.)
  942. .SH FILES
  943. .TP 30
  944. /usr/lib/graphics/gd.site
  945. contains default site name
  946. .TP
  947. /etc/cpu
  948. contains local host name
  949. .TP
  950. /dev/Gr/[0123]
  951. Grinnell Image Planes
  952. .TP
  953. /dev/Gr/gov[0123]
  954. Grinnell Graphics Overlays
  955. .TP
  956. /dev/ct[012]
  957. Comtal images
  958. .TP
  959. /dev/ct/tc
  960. Comtal status
  961. .TP
  962. /dev/ct/gov[012]
  963. Comtal graphic overlays
  964. .SH AUTHOR
  965. Carl Crawford
  966. and Malcolm Slaney
  967. .SH SEE ALSO
  968. graphics/crc 
  969. SHAR_EOF
  970. cat << \SHAR_EOF > gp.1g
  971. .TH GP 1g "CRC Graphics Package"
  972. .SH NAME
  973. gp - graphics plot to versatec
  974. .SH SYNOPSIS
  975. gp [-ahfi] [-mHOST] file1 file2 ... filen
  976. .SH DESCRIPTION
  977. This command is obsolete on all ECN machines except for
  978. ARPA.
  979. Users desiring output on other ECN versatec machines should
  980. use 
  981. .I plot(5g)
  982. format and send the plot to the versatec using
  983. the 
  984. .I plot(1g) 
  985. command.
  986. .PP
  987. Gp copies graphic files to a Versatec plotter.
  988. The
  989. input files are `or'ed together to form one picture.
  990. The -i flag will force the first file to be read from standard input.
  991. .PP
  992. Gp can be initiated from any machine on the network. 
  993. The output will
  994. come out on the Versatec connected to the ARPA machine.
  995. Also file names `0', `1', and `2'
  996. refer to the Comtal graphics overlays 0, 1, and 2,
  997. respectively.
  998. .PP
  999. The option -f produces 4:1 output only on the
  1000. ARPA Versatec. The option -h, which is a
  1001. default flag, produces 2:1 output.
  1002. .PP
  1003. The flag -s causes 
  1004. .I gp
  1005. not to output the message given to the
  1006. user when 
  1007. .I gp
  1008. finishes.
  1009. .PP
  1010. The -m flag is used to change the name of the host where the
  1011. output is sent to. The characters immediately after `m' form the name
  1012. of the new site. 
  1013. As an example,
  1014. the command "gp -marpa file" will always send the output
  1015. to the Versatec on the ARPA machine.
  1016. .SH FILES
  1017. .TP 30
  1018. /usr/lib/graphics/gp.site
  1019. default site specifications
  1020. .TP
  1021. /etc/cpu
  1022. contains local host name
  1023. /dev/vc
  1024. Versatec
  1025. .SH AUTHOR
  1026. Carl Crawford
  1027. .SH SEE ALSO
  1028. gplp(1),
  1029. qplot(1),
  1030. graphics/crc 
  1031. .SH NOTES
  1032. The file `gp.site' contains the name of the machine where the
  1033. output is routed. If the machine has a Versatec then the name
  1034. should be `local #', where # is the length of the Versatec
  1035. line buffer. 
  1036. For the ARPA Versatec, # is 132.
  1037. SHAR_EOF
  1038. cat << \SHAR_EOF > gplp.1g
  1039. .TH GPLP 1g "CRC Graphics Package"
  1040. .SH NAME
  1041. gplp - graphics print on a line printer
  1042. .SH SYNOPSIS
  1043. gplp [-XX] [-i] file1 ... filen
  1044. .SH DESCRIPTION
  1045. .I Gplp
  1046. copies graphic files to a Printronix line
  1047. printer.
  1048. The input files are `or'ed together to form one picture.
  1049. The -i flag will force the first file to be read from standard input.
  1050. .PP
  1051. Depending on which host machine `gplp' is run from, the output will
  1052. go to various line printers on the network. 
  1053. As of this date the following table
  1054. indicates which host's Printronix will be used for each originating
  1055. computer:
  1056. .ta 1i 3i
  1057. .nf
  1058.     ORIGINATING    OPR SITE
  1059.       MACHINE      -XX
  1060.        aa       ep
  1061.        ca       cp
  1062.        cb       cp
  1063.        ea       ep
  1064.        ec       ep
  1065.        ed       ep
  1066.        ee       ep
  1067.        ef       ep
  1068.        eg       em
  1069.        ga       ep
  1070.        gb       ep
  1071.        ka       ep
  1072.        ma       mp
  1073.        mb       mp
  1074.        pa       pp
  1075.        pb       pp
  1076.        pc       pp
  1077.        eeg       ep
  1078.       arpa       ep
  1079. .fi
  1080. .PP
  1081. The default site name can be changed using the
  1082. -XX option.
  1083. See 
  1084. .I opr(1)
  1085. for more information about the
  1086. valid printer sites.
  1087. .SH FILES
  1088. /usr/lib/graphics/gplp.site    contains default site name
  1089. .SH AUTHOR
  1090. Carl Crawford
  1091. .SH SEE ALSO
  1092. qplot(1), 
  1093. gp(1), 
  1094. graphics/crc 
  1095. .SH NOTES
  1096. The file `gplp.site' has the form `-XX<cr>', where XX is the
  1097. name of the default line printer.
  1098. SHAR_EOF
  1099. cat << \SHAR_EOF > hpd.1g
  1100. .TH HPD 1g "CRC Graphics Package"
  1101. .SH NAME
  1102. hpd - HP plotter driver
  1103. .SH SYNOPSIS
  1104. hpd [-mHOST] [device]
  1105. .SH DESCRIPTION
  1106. Hpd is an interface program between the output of the
  1107. plotting subroutines and the HP plotter.
  1108. It passes standard input to the plotter
  1109. specified by the `device' field.
  1110. Specification of a host with the `-m' flag
  1111. will cause:
  1112. .sp
  1113.            HOST!/usr/lib/graphics/hpd [device]
  1114. .sp
  1115. to be executed.
  1116. Thus, any plotter on the network can be reached.
  1117. .PP
  1118. The default HOST is contained in the
  1119. file:
  1120. .sp
  1121.            /usr/lib/graphics/hpd.site. 
  1122. .sp
  1123. The file contains `local' if there is a plotter on the
  1124. machine or the name of a HOST that has
  1125. a plotter.
  1126. .PP
  1127. The program will time out after 3 minutes after the
  1128. plotter hangs.
  1129. .PP
  1130. This program unfortunately only knows about one plotter per machine.
  1131. The 
  1132. .I plot(1g)
  1133. routine in conjunction with the 
  1134. .I -P
  1135. option to 
  1136. .I qplot
  1137. or
  1138. .I plot3d
  1139. can be used to send output to the other plotter(s).
  1140. .SH FILES
  1141. .TP 30
  1142. /usr/lib/graphics/hpd.site
  1143. contains default site name
  1144. .TP
  1145. /dev/plt0
  1146. default path to plotter
  1147. .TP
  1148. /etc/cpu
  1149. contains local host name
  1150. .SH AUTHOR
  1151. Carl Crawford
  1152. .SH SEE ALSO
  1153. graphics/crc 
  1154. SHAR_EOF
  1155. cat << \SHAR_EOF > laxis.3g
  1156. .TH LAXIS 3g "CRC Graphics Package"
  1157. .SH NAME
  1158. laxis - draw a logarithmic axis
  1159. .SH SYNOPSIS
  1160. .nf
  1161. >From C:
  1162.     float x,y,size;
  1163.     int xy,logmin,logmax,flag;
  1164.     char *label;
  1165.  
  1166.     laxis(x,y,label,xy,size,logmin,logmax,flag);
  1167.     
  1168. >From F77:
  1169.     real x,y,size
  1170.     integer xy,logmin,logmax,flag
  1171.     character label()
  1172.  
  1173.     call laxis(x,y,label,xy,size,logmin,logmax,flag)
  1174. .fi
  1175. .SH DESCRIPTION
  1176. .I Laxis
  1177. draws
  1178. a labelled logarithmic coordinate axis with numerically
  1179. annotated tic marks.
  1180. The following parameters are used:
  1181. .TP 10
  1182. x,y
  1183. the coordinates of the starting point
  1184. of the axis.
  1185. .TP
  1186. label
  1187. a pointer to a zero terminated string which is to be used
  1188. as an axis label.
  1189. .TP
  1190. xy
  1191. 0: plot the axis at zero degrees, tic marks below the axis.
  1192. .br
  1193. 1: plot the axis at ninety degrees, tic marks to the left of the axis.
  1194. .br
  1195. 2: plot the axis at zero degrees, tic marks above the axis.
  1196. .br
  1197. 3: plot the axis at ninety degrees, tic marks to the right of the axis.
  1198. .TP
  1199. size
  1200. the length of the coordinate axis in plot units.
  1201. .TP
  1202. logmin
  1203. the exponent corresponding to the first tic mark of the axis (at the
  1204. point (x,y)), usually the floor of the min computed by 'scale'.
  1205. .TP
  1206. logmax
  1207. the exponent corresponding to the last tic mark of the axis, usually
  1208. the ceiling of the max computed by 'scale'.
  1209. .TP
  1210. flag
  1211. 0: default, all logarithmic tic marks plotted.
  1212. .br
  1213. \+\/\- 1: no logarithmic tic marks plotted.
  1214. .br
  1215. \+\/\-\ \2: only the logarithmic tic marks \
  1216. corresponding to 2 and 5 are plotted.
  1217. .br
  1218. \+\/\- 3: all logarithmic tic marks are plotted.
  1219. .br
  1220. If flag is negative, no numerical annotation will be done.
  1221. .SH REMARKS
  1222. The user must supply 
  1223. .I scale, line, 
  1224. .I and 
  1225. .I dline
  1226. with the log base 10
  1227. of the data to be plotted. 
  1228. Also, the min and max supplied to 
  1229. .I line
  1230. and 
  1231. .I dline
  1232. must be logmin and logmax, respectively.
  1233. .SH AUTHOR
  1234. Jeffery L. Gray
  1235. SHAR_EOF
  1236. cat << \SHAR_EOF > libinfo.8g
  1237. .TH LIBINFO 8g "CRC Graphics Package"
  1238. .SH NAME
  1239. Library Information
  1240. .SH DESCRIPTION
  1241. The graphics library (/u/lib/libG.a) contains user callable
  1242. subroutines for generating graphics. 
  1243. They all are callable from
  1244. a program written in C or F77. 
  1245. The only restriction on the calling
  1246. sequence is that 
  1247. .I plots
  1248. is called before any other plot calls
  1249. and `plot(0.0,0.0,999)' is the last call. 
  1250. It should be noted that
  1251. after the plot is terminated, 
  1252. .I plots(3g)
  1253. can be called again.
  1254. .PP
  1255. Here is a list
  1256. of the available routines:
  1257. .nf
  1258. .ta 1i
  1259. alpha    returns Tektronix to alpha-numeric mode
  1260. axis    plots numerically annotated axes
  1261. axisv    set environment variables for \fIaxis\fR and \fIlaxis\fR
  1262. dline    same as \fIline\fR but plots with a dashed line
  1263. factor    change the scale factor of the plot
  1264. fname    set output file name when graphics device is a file
  1265. laxis    plots numerically annotated logarithmic axes
  1266. line    plots a line through a set of coordinate pairs
  1267. newpen    changes the pen on the HP plotter
  1268. number    provides formatted numeric labelling
  1269. plot    moves pen and terminates plotting
  1270. plots    initializes the plotting devices
  1271. scale    computes scale values for \fRline\fR, \fIdline\fR, and \fIsline\fR
  1272. site    change the default line printer name in link to Gplp
  1273. sline    same as \fIline\fR but can put on-center symbols on the line
  1274. speed    changes the plotting speed for the HP plotter
  1275. symbol    puts strings on the graph
  1276. where    returns current pen position and scale values
  1277. .PP
  1278. Compile your program with 
  1279. one of the following commands:
  1280. .sp
  1281. .nf
  1282.     From F77 (11's):
  1283.         $f77 prog.f -i -lG
  1284.     From F77 (Vax):
  1285.         $f77 prog.f -lG
  1286.     From C (11's):
  1287.         $cc prog.c -i -lG -lm
  1288.     From C (Vax):
  1289.         $cc prog.c -lG -lm
  1290. .fi
  1291. .SH SEE ALSO
  1292. See the CRC Graphics Introduction for more information.
  1293. SHAR_EOF
  1294. cat << \SHAR_EOF > line.3g
  1295. .TH LINE 3g "CRC Graphics Package"
  1296. .SH NAME
  1297. line - draw a parametric line
  1298. .SH SYNOPSIS
  1299. .nf
  1300. >From C:
  1301.     float   *x,*y,lx,ly;
  1302.     int     n,bar;
  1303.  
  1304.     line(x,y,n,bar,lx,ly);
  1305.  
  1306. >From F77:
  1307.     real    x(),y(),lx,ly
  1308.     integer n,bar
  1309.  
  1310.     call line(x,y,n,bar,lx,ly)
  1311. .fi
  1312. .SH DESCRIPTION
  1313. To draw a line of a parametric relationship (x[i],y[i]), i=0,2,...,n-1.
  1314. The 
  1315. .I i=n'th
  1316. and
  1317. .I i=n+1'th
  1318. elements of each array should represent the minimum and maximum values
  1319. of the points in that vector.
  1320. The user can call the routine
  1321. .I scale(3g)
  1322. to automatically find the minimum and maximum values.
  1323. The following parameters are used:
  1324. .TP 10
  1325. x,y
  1326. pointers to arrays containing the x and y coordinates of the
  1327. parametric relationship (x[i],y[i]).
  1328. .TP
  1329. n
  1330. the number of points in the parametric relationship.
  1331. .TP
  1332. bar
  1333. normally a straight line is drawn between two points but if bar
  1334. is non-zero, zero order interpolation will be used between points.
  1335. .TP
  1336. lx
  1337. the length (in plot units) that (xmax - xmin) is mapped to in page
  1338. coordinates.
  1339. .TP
  1340. ly
  1341. the length (in plot units) that (ymax - ymin) is mapped to in
  1342. page coordinates.
  1343. .SH REMARKS
  1344. The Xi's and Yi's need not represent plot coordinates in inches.
  1345. .PP
  1346. The minimum and maximum values for the arrays must be stored
  1347. in the n+1st and n+2nd locations of the arrays respectively.
  1348. This can be easily done using the
  1349. routine 
  1350. .I scale(3g).
  1351. .PP
  1352. The point (x[i],y[i]) will be plotted at the page coordinates:
  1353. .nf
  1354.  
  1355.     x = ((x[i] - x[n]) / (x[n+1] - x[n])) * lx
  1356.     y = ((y[i] - y[n]) / (y[n+1] - y[n])) * ly
  1357.  
  1358. .fi
  1359. relative to the current origin. Hence depending upon the location
  1360. of the current origin, the adjusted minima need not actually be
  1361. the minima of the data which is to be plotted so long as each point
  1362. (x[i],y[i]) has page coordinates which lie within the plotting area.
  1363. .PP
  1364. An error will occur if xmin = xmax or ymin = ymax.
  1365. .PP
  1366. The values of 
  1367. .I lx
  1368. and 
  1369. .I ly
  1370. are normally the values passed to
  1371. the axis subroutines.
  1372. SHAR_EOF
  1373. cat << \SHAR_EOF > newpen.3g
  1374. .TH NEWPEN 3g "CRC Graphics Package"
  1375. .SH NAME
  1376. newpen - change pens on the HP plotter
  1377. .SH SYNOPSIS
  1378. .nf
  1379. >From C:
  1380.     int     n;
  1381.  
  1382.     newpen(n);
  1383.     
  1384. >From F77:
  1385.     integer n
  1386.  
  1387.     call newpen(n)
  1388. .fi
  1389. .SH DESCRIPTION
  1390. To deselect the current pen and select one of the other
  1391. pens in the HP plotter.
  1392. The command is ignored if the HP plotter is not the selected
  1393. output device.
  1394. .I N
  1395. should be set to
  1396. the bin number of the new pen, n=1,2,3,4, which is to be
  1397. selected.
  1398. .SH REMARKS
  1399. Initially, pen 1 is selected.
  1400. When a pen is selected, the current pen is raised and the newly
  1401. selected pen is left in the up position.
  1402. .PP
  1403. If n is the number of the currently selected pen, it is raised
  1404. and left in the up position.
  1405. SHAR_EOF
  1406. cat << \SHAR_EOF > number.3g
  1407. .TH NUMBER 3g "CRC Graphics Package"
  1408. .SH NAME
  1409. number - provide numeric labelling on plots
  1410. .SH SYNOPSIS
  1411. .nf
  1412. >From C:
  1413.     float   x,y,height,angle;
  1414.     char    *format;
  1415.     (num type must conform with format)
  1416.  
  1417.     number(x,y,height,angle,format,num);
  1418.     
  1419. >From F77:
  1420.     real    x,y,height,angle
  1421.     character format()
  1422.     (num type must conform with format)
  1423.  
  1424.     call number(x,y,height,angle,format,num)
  1425. .fi
  1426. .SH DESCRIPTION
  1427. This routine plots a single number.  
  1428. It is usually used as part of plotting the axis and the
  1429. following parameters are used.
  1430. .TP 10
  1431. x,y
  1432. the coordinates of the point where the
  1433. lower left corner of the first character is to be plotted.
  1434. .TP
  1435. height
  1436. the height (in plot units) of the alphanumeric character
  1437. string. 
  1438. .TP
  1439. angle
  1440. the angle (in degrees) counterclockwise from the +x direction
  1441. at which the string is to be plotted.
  1442. .TP
  1443. format
  1444. a pointer to a zero terminated string which contains the `C format'
  1445. by which num is to be converted for plotting. 
  1446. .TP
  1447. num
  1448. the number whose value is to be plotted.
  1449. .SH REMARKS
  1450. >From f77 integers must be printed out using the `c' format %ld, since fortran
  1451. integers are two bytes.
  1452. .PP
  1453. The width of the characters is four-sevenths of height and they
  1454. are spaced at intervals of six-sevenths of height. The space
  1455. between characters is two-sevenths of height.
  1456. .PP
  1457. A second set of characters can be accessed by preceeding a valid
  1458. character with a `$'. A `$' can be obtained using `$$'. The second
  1459. set contains Greek letters and some special mathematical
  1460. symbols.
  1461. See 
  1462. .I fontinfo(8g)
  1463. for more information about this alternate
  1464. character font.
  1465. .PP
  1466. See the documentation for 
  1467. .I printf(3)
  1468. for more information on the
  1469. syntax of the format statement 
  1470. .I number
  1471. expects.
  1472. SHAR_EOF
  1473. cat << \SHAR_EOF > plot.3g
  1474. .TH PLOT 3g "CRC Graphics Package"
  1475. .SH NAME
  1476. plot - move the pen
  1477. .SH SYNOPSIS
  1478. .nf
  1479. >From C:
  1480.     float   x,y;
  1481.     int     i;
  1482.  
  1483.     plot(x,y,i);
  1484.     
  1485. >From F77:
  1486.     real    x,y
  1487.     integer i
  1488.  
  1489.     call plot(x,y,i)
  1490. .fi
  1491. .SH DESCRIPTION
  1492. To provide for moving the pen in a straight line from its
  1493. current position to a new position, and for terminating
  1494. the plotting subroutines.
  1495. The following parameters are used.
  1496. .TP 10
  1497. x,y
  1498. the coordinates of the point (in plot units) to which the
  1499. pen is to be moved relative to the current origin.
  1500. .TP
  1501. i
  1502. .nf
  1503. +/- 1: do not change vertical position of pen.
  1504. +/- 2: put pen into down position.
  1505. +/- 3: put pen into up position.
  1506.   999: terminate plot subroutines
  1507. .fi
  1508. .SH REMARKS
  1509. .PP
  1510. If 
  1511. .I i
  1512. is +/- 1, +/- 2, or +/- 3, the pen is moved from
  1513. its current position to the point (x,y) along a straight
  1514. line with the vertical position of the pen as specified.
  1515. .PP
  1516. If 
  1517. .I i
  1518. is -1, -2, or -3, the point (x,y) becomes the new
  1519. origin for subsequent plotting. Unless and until the origin
  1520. is again redefined, all future coordinates will specify
  1521. positions with respect to this point.
  1522. .PP
  1523. If 
  1524. .I i
  1525. is 999, the values of x and y are disregarded and may as
  1526. well be `0.0'. 
  1527. An error will occur if subsequent plot calls are made 
  1528. prior to another call to 
  1529. .I plots.
  1530. SHAR_EOF
  1531. cat << \SHAR_EOF > plots.3g
  1532. .TH PLOTS 3g "CRC Graphics Package"
  1533. .SH NAME
  1534. plots - initialize CRC Graphics Package
  1535. .SH SYNOPSIS
  1536. .nf
  1537. >From C:
  1538.     int     dev,overwrite;
  1539.     char    *options;
  1540.  
  1541.     plots(dev,overwrite,options);
  1542.     
  1543. >From F77:
  1544.     integer dev,overwrite
  1545.     char options()
  1546.  
  1547.     call plots(dev,overwrite,options)
  1548. .fi
  1549. .SH DESCRIPTION
  1550. Plots is used to allocate buffers and initialize the devices
  1551. before plotting can begin. 
  1552. Except for calls to 
  1553. .I site(3g)
  1554. and 
  1555. .I fname(3g)
  1556. this subroutine must be called
  1557. before any other subroutines are called.
  1558. The following parameters should be passed to 
  1559. .I plots.
  1560. .TP 10
  1561. dev
  1562. The device the plot should be sent to.  The following device
  1563. numbers are currently supported (add 64 to the number in the table
  1564. if the option string is used):
  1565. .ta .1i 1i
  1566. .nf
  1567.     0    file or standard output
  1568.     8    Versatec through gp(1g) (ARPA Machine Only!!!)
  1569.     16    Printronix through gplp (1g) and opr (1g)
  1570.     
  1571.     1    Comtal graphics overlay 0(*)
  1572.     9    Comtal graphics overlay 1(*)
  1573.     17    Comtal graphics overlay 2(*)
  1574.     
  1575.     2    Comtal image image displayed(*)
  1576.     10    Comtal image 0(*)
  1577.     18    Comtal image 1(*)
  1578.     26    Comtal image 2(*)
  1579.     
  1580.     3    Grinnell graphics overlay 0(*)
  1581.     11    Grinnell graphics overlay 1(*)
  1582.     19    Grinnell graphics overlay 2(*)
  1583.     27    Grinnell graphics overlay 3(*)
  1584.     
  1585.     4    Grinnell Image being Displayed (*)
  1586.     12    Grinnell Image Plane 0(*)
  1587.     20    Grinnell Image Plane 1(*)
  1588.     28    Grinnell Image Plane 2(*)
  1589.     36    Grinnell Image Plane 3(*)
  1590.     44    Grinnell Image Plane 4(*)
  1591.     
  1592.     5    Plot Subroutines through plot(I)
  1593.     
  1594.     6    Tektronix through standard output
  1595.     14    Retro-Graphics through standard output
  1596.     22    Tektronix 4113
  1597.     
  1598.     7    HP through /u/lib/graphics/hpd
  1599. .fi
  1600. The output to those devices marked (*) is sent via the
  1601. .I gd(1g)
  1602. program.
  1603. .TP
  1604. overwrite
  1605. If this parameters is zero then
  1606. the specified device will be cleared before plotting.
  1607. Otherwise (if overwrite is non zero) then the new plot will overwrite whatever
  1608. is currently being displayed.
  1609. .TP
  1610. options
  1611. A null terminated string that contains options for 
  1612. .I gplp(1g), hpd(1g), gd(1g)
  1613. and 
  1614. .I plot(1g). 
  1615. The value passed as 
  1616. .I dev
  1617. must be 64 plus the number found in the table above
  1618. for this string to be used.
  1619. When 
  1620. .I dev 
  1621. is equal to 69
  1622. then the 
  1623. .I plot(5) 
  1624. output is automatically
  1625. passed to
  1626. .I plot(1g).
  1627. The 
  1628. .I options
  1629. string is appened to the string ``-T'' and the result
  1630. is passed as the first argument to 
  1631. .I plot(1g).
  1632. Thus use 
  1633. .I 
  1634. plots(69,0,"ver")
  1635. \fRto use the Versatec through the 
  1636. .I plot(1g)
  1637. program,
  1638. .I 
  1639. plots(71,0,"eg")
  1640. \fRto send a plot to the a HP plotter on the `eg' machine.
  1641. .I plots(6,0)
  1642. is also a valid plots call when the option string isn't needed.
  1643. .SH REMARKS
  1644. The default file name when 
  1645. .I dev
  1646. equals zero can be changed using the
  1647. subroutine 
  1648. .I fname.
  1649. Also if the file
  1650. exists in the
  1651. local directory before plotting begins, then the
  1652. new graphics will overlay the graphics contained in `file'.
  1653. .PP
  1654. For dev=printronix(16) there exists a subroutine 
  1655. .I site(3g)
  1656. to change the
  1657. name of the default line printer.
  1658. .PP
  1659. Space limitations occur on the PDP 11 computers
  1660. when the device selected is a 
  1661. bit mode device (all dev numbers except for 3, 4, 11).
  1662. For these devices the software has to allocate
  1663. an 64K byte buffer. If your program has a lot of
  1664. text and data, then the graphics software can't get
  1665. its space. An error message will printed in these
  1666. situations. When you are on the 11's try compiling
  1667. your program with the loader option `-i' to get
  1668. more space for data.
  1669. .PP
  1670. The origin is set to (0,0) before plotting begins. This
  1671. coordinate is the lower left hand corner of the plot
  1672. device.
  1673. .PP
  1674. The 
  1675. .I options
  1676. field is an optional parameter. 
  1677. It is intended for advanced applications of the
  1678. package with special emphasis placed on the
  1679. network interface and future expansion of 
  1680. device daemons.
  1681. .SH NOTE
  1682. If the CRC-Graphics routines
  1683. .I fname(3g)
  1684. and 
  1685. .I site(3g)
  1686. are needed then they
  1687. must be called before the first call to 
  1688. .I plots(3g).
  1689. SHAR_EOF
  1690. cat << \SHAR_EOF > scale.3g
  1691. .TH SCALE 3g "CRC Graphics Package"
  1692. .SH NAME
  1693. scale - find the minimum and maximum values of a vector
  1694. .SH SYNOPSIS
  1695. .nf
  1696. >From C:
  1697.     float   *a;
  1698.     int     n;
  1699.  
  1700.     scale(a,n);
  1701.     
  1702. >From F77:
  1703.     real    a()
  1704.     integer n
  1705.  
  1706.     call scale(a,n)
  1707. .fi
  1708. .SH DESCRIPTION
  1709. This routine is most often used to find the minimum and maximum values
  1710. of a vector.
  1711. The result is placed at the end of the vector in
  1712. locations
  1713. .I a[n]
  1714. and
  1715. .I a[n+1]
  1716. (here the array subscripting is assumed to start from zero as in C).
  1717. The first argument
  1718. .I a
  1719. is a pointer to an array
  1720. and 
  1721. .I n
  1722. is the number of points in the array.
  1723. .SH REMARKS
  1724. The array must be dimensioned at least n+2. The minimum value
  1725. of the array is stored in a[n] and the maximum is stored in
  1726. a[n+1].
  1727. .PP
  1728. In Fortran arrays are referenced starting from 1 so
  1729. the minimum value is stored in a(n+1) and the maximum is stored
  1730. in a(n+2).
  1731. .PP
  1732. The minimum and maximum values are NOT adjusted to pleasing
  1733. values as they are with the CDC Calcomp routines. 
  1734. This is because it
  1735. is difficult to define pleasing and the author prefers to see the
  1736. maximum and minimum values on the axis.
  1737. .PP
  1738. If the integer flag is used with the axis subroutine, then the
  1739. min and max values returned by scale should be
  1740. adjusted so that (max - min) is divisable by (size / ticdis).
  1741. SHAR_EOF
  1742. cat << \SHAR_EOF > site.3g
  1743. .TH SITE 3g "CRC Graphics Package"
  1744. .SH NAME
  1745. site - change default line printer site
  1746. .SH SYNOPSIS
  1747. .nf
  1748. >From C:
  1749.     char *s;
  1750.  
  1751.     site(s);
  1752.     
  1753. >From F77:
  1754.     character s()
  1755.  
  1756.     call site(s)
  1757. .fi
  1758. .SH DESCRIPTION
  1759. This routine is used to change the default line printer site for
  1760. .I gplp (1g).
  1761. The parameter, 
  1762. .I s,
  1763. is a null terminated string of the form: ``-XX'', where
  1764. XX is the name of the printer.
  1765. .SH REMARKS
  1766. .I site
  1767. must be called before the call to 
  1768. .I plots.
  1769. .PP
  1770. See 
  1771. .I opr(1)
  1772. for more information about the line printer names.
  1773. .PP
  1774. The line printer must be a Printronix.
  1775. SHAR_EOF
  1776. cat << \SHAR_EOF > sline.3g
  1777. .TH SLINE 3g "CRC Graphics Package"
  1778. .SH NAME
  1779. sline - draw a parametric line with on-center symbols
  1780. .SH SYNOPSIS
  1781. .nf
  1782. >From C:
  1783.     float *x,*y,lx,ly;
  1784.     int n,j,sym;
  1785.  
  1786.     sline(x,y,n,lx,ly,j,sym);
  1787.     
  1788. >From F77:
  1789.     real x(),y(),lx,ly
  1790.     integer n,j,sym
  1791.  
  1792.     call sline(x,y,n,lx,ly,j,sym)
  1793. .fi
  1794. .SH DESCRIPTION
  1795. To draw a line of a parametric relationship (x[i],y[i]), i=0,2,...,n-1,
  1796. with on-center symbols plotted every jth point.
  1797. The 
  1798. .I i=n'th
  1799. and
  1800. .I i=n+1'th
  1801. elements of each array should represent the minimum and maximum values
  1802. of the points in that vector.
  1803. The user can call the routine
  1804. .I scale(3g)
  1805. to automatically find the minimum and maximum values.
  1806. The following parameters are used:
  1807. .TP 10
  1808. x,y
  1809. Pointers to arrays containing the x and y coordinates of the
  1810. parametric relationship (x[i],y[i]).
  1811. .TP
  1812. n
  1813. The number of points in the parametric relationship.
  1814. .TP
  1815. lx
  1816. The length (in plot units) that (xmax - xmin) is mapped to in page
  1817. coordinates.
  1818. .TP
  1819. ly
  1820. The length (in plot units) that (ymax - ymin) is mapped to in
  1821. page coordinates. 
  1822. .TP
  1823. j
  1824. Plot the on-center symbol specified by `sym` at every |j|th point.
  1825. if j is negative, no line is drawn between on-center symbols.
  1826. .TP
  1827. sym
  1828. Specifies which on-center symbol is to be used.
  1829. The following on-center symbols can be used.
  1830. .ta 1i 2i
  1831. .nf
  1832.     \fIsym    on-center symbol\fR
  1833.  
  1834.      0    no on-center symbol
  1835.      i    $'i-1'    i=1,2,...,10
  1836.     11           $*
  1837.     12           $+
  1838.     13           $,
  1839. .fi
  1840. .SH REMARKS
  1841. The Xi's and Yi's need not represent plot coordinates.
  1842. .PP
  1843. The minimun and maximum values for the arrays must be stored
  1844. in the n+1st and n+2nd locations of the arrays respectively.
  1845. .PP
  1846. The point (x[i],y[i]) will be plotted at the page coordinates:
  1847. .nf
  1848.  
  1849.     x = (x[i] - x[n]) / (x[n+1] - x[n]) * lx
  1850.     y = (y[i] - y[n]) / (y[n+1] - y[n]) * ly
  1851.  
  1852. .fi
  1853. relative to the current origin. Hence depending upon the location
  1854. of the current origin, the adjusted minima need not actually be
  1855. the minima of the data which is to be plotted so long as each point
  1856. (x[i],y[i]) has page coordinates which lie within the plotting area.
  1857. .PP
  1858. An error will occur if xmin = xmax or ymin = ymax.
  1859. SHAR_EOF
  1860. cat << \SHAR_EOF > speed.3g
  1861. .TH SPEED 3g "CRC Graphics Package"
  1862. .SH NAME
  1863. speed - change plotting speed of the HP plotter
  1864. .SH SYNOPSIS
  1865. .nf
  1866. >From C:
  1867.     int vel
  1868.  
  1869.     speed(vel);
  1870.     
  1871. >From F77:
  1872.     integer vel
  1873.  
  1874.     call speed(vel)
  1875. .fi
  1876. .SH DESCRIPTION
  1877. The quality of a plot on an HP plotter is dependent on the
  1878. quality of the pen and the speed at which it is moved 
  1879. across the paper.
  1880. Generally as a pen ages and dries out a slower velocity can
  1881. be used to maintain the quality of the plot.
  1882. .PP
  1883. The single parameter
  1884. .I speed
  1885. is the velocity of the pen in cm/sec. 
  1886. The valid range is [1,36].
  1887. The default velocity is 36 cm/sec.
  1888. .SH REMARKS
  1889. Higher quality output is obtained at lower velocities.
  1890. SHAR_EOF
  1891. cat << \SHAR_EOF > strip7.1g
  1892. .TH STRIP7 1g "CRC Graphics Package"
  1893. .SH NAME
  1894. strip7 - remove byte counts from f77 data files
  1895. .SH SYNOPSIS
  1896. strip7 [-r] file1 ...
  1897. .SH DESCRIPTION
  1898. Strip7 removes the byte counts that f77 puts
  1899. into its binary output files.
  1900. The 'stripped' files replace the original files.
  1901. The '-r' option causes the 'stripped' files
  1902. to be placed in a new files. The new file names are
  1903. the original file names with a ".s7" suffix. 
  1904. .SH COMMENT
  1905. Plots will be obtained even if 'strip7' is not run before
  1906. calling 
  1907. .I qplot (1g)
  1908. and 
  1909. .I plot3d(1g).
  1910. The resulting graphics will be garbage
  1911. because 
  1912. .I qplot
  1913. and
  1914. .I plot3d
  1915. will interpret the byte count as a floating point number and
  1916. it is usually much larger than any data in the user`s file..
  1917. .SH FILES
  1918. .TP 14
  1919. strip7.tmp
  1920. temp file 
  1921. .SH AUTHOR
  1922. Carl Crawford
  1923. .SH BUGS
  1924. The maximum record length is only 4096 bytes.
  1925. SHAR_EOF
  1926. cat << \SHAR_EOF > symbol.3g
  1927. .TH SYMBOL 3g "CRC Graphics Package"
  1928. .SH NAME
  1929. symbol - add alphanumeric labelling to a plot
  1930. .SH SYNOPSIS
  1931. .nf
  1932. >From C:
  1933.     float x,y,height,angle;
  1934.     char *string;
  1935.  
  1936.     symbol(x,y,height,string,angle);
  1937.     
  1938. >From F77:
  1939.     real x,y,height,angle
  1940.     character string()
  1941.  
  1942.     call symbol(x,y,height,string,angle)
  1943. .fi
  1944. .SH DESCRIPTION
  1945. The 
  1946. .I symbol
  1947. routine adds alphanumeric notation to a plot.
  1948. The location, size, angle and string to be plotted
  1949. are specified with the following parameters.
  1950. .TP 10
  1951. x,y
  1952. the coordinates of the point where the
  1953. lower left corner of the first character is to be plotted.
  1954. .TP
  1955. height
  1956. the height (in plot units) of the alphanumeric character
  1957. string.
  1958. .TP
  1959. string
  1960. a pointer to a zero terminated string.
  1961. .TP
  1962. angle
  1963. the angle (in degrees) counterclockwise from the +x direction
  1964. at which the string is to be plotted.
  1965. .SH REMARKS
  1966. The width of the characters is four-sevenths of height and they
  1967. are spaced at intervals of six-sevenths of height. The space
  1968. between characters is two-sevenths of height.
  1969. .PP
  1970. A second set of characters can be accessed by preceeding a valid
  1971. character with a `$'. (A `$' can be obtained using `$$'.)
  1972. The second
  1973. font contains Greek letters and some special mathematical
  1974. symbols.
  1975. See 
  1976. .I fontinfo(8g)
  1977. for more information about this alternate character
  1978. font.
  1979. SHAR_EOF
  1980. cat << \SHAR_EOF > where.3g
  1981. .TH WHERE 3g "CRC Graphics Package"
  1982. .SH NAME
  1983. where - return current pen position
  1984. .SH SYNOPSIS
  1985. .nf
  1986. >From C:
  1987.     float   x,y,sf;
  1988.  
  1989.     where(&x,&y,&sf);
  1990.     
  1991. >From F77:
  1992.     real    x,y,sf
  1993.  
  1994.     call where(x,y,sf)
  1995. .fi
  1996. .SH DESCRIPTION
  1997. This routine aids in the optimization of plotting by returning the current
  1998. pen coordinates and scale factor to the calling program.
  1999. The current state is returned in the following variables:
  2000. .TP 10
  2001. x,y
  2002. variables for the return of the current pen coordinates
  2003. relative to the current origin.
  2004. .TP
  2005. sf
  2006. variable for the return of the current scale factor.
  2007. .SH REMARKS
  2008. Values of 
  2009. .I x, y, 
  2010. and 
  2011. .I sf
  2012. when this subroutine is called are
  2013. disregarded.
  2014. .PP
  2015. Subroutine 
  2016. .I where
  2017. can be used, for example, to determine which
  2018. direction a line between the points (x1,y1) and (x2,y2) should
  2019. be drawn in order to reduce pen movement when the pen position
  2020. is unknown.
  2021. SHAR_EOF
  2022. chdir ..
  2023. #    End of shell archive
  2024. exit 0
  2025.  
  2026. -- 
  2027.  
  2028. Rich $alz            "Anger is an energy"
  2029. Cronus Project, BBN Labs    rsalz@bbn.com
  2030. Moderator, comp.sources.unix    sources@uunet.uu.net
  2031.