home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / unix / 271 < prev    next >
Encoding:
Text File  |  1992-09-08  |  90.2 KB  |  3,694 lines

  1. Newsgroups: comp.sources.unix
  2. Path: sparky!uunet!decwrl!pa.dec.com!vixie
  3. From: mogul@dec.com (Jeff Mogul)
  4. Subject: v26i072: psgraph - generate graph in Postscript, Part01/03
  5. Message-ID: <1992Sep8.005823.13410@PA.dec.com>
  6. Originator: vixie@cognition.pa.dec.com
  7. Sender: unix-sources-moderator@pa.dec.com
  8. Organization: DEC Palo Alto
  9. Date: Tue, 8 Sep 92 00:58:23 GMT
  10. Approved: vixie@pa.dec.com
  11. Lines: 3681
  12.  
  13. Submitted-By: mogul@dec.com (Jeff Mogul)
  14. Posting-Number: Volume 26, Issue 72
  15. Archive-Name: psgraph/part01
  16.  
  17.  
  18. "Psgraph" takes input files vaguely like those accepted by graph(1),
  19. and produces PostScript output.  The manual page explains the rest.
  20.  
  21. Please obey the part in the LICENSE file that says not to redistribute
  22. this software to anyone, unless you do it for free and include the
  23. LICENSE file and all copyright notices.
  24.  
  25. #! /bin/sh
  26. # This is a shell archive.  Remove anything before this line, then unpack
  27. # it by saving it into a file and typing "sh file".  To overwrite existing
  28. # files, type "sh file -c".  You can also feed this as standard input via
  29. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  30. # will see the following message at the end:
  31. #        "End of archive 1 (of 3)."
  32. # Contents:  LICENSE MANIFEST Makefile README examples
  33. #   examples/Makefile examples/README examples/distribb.data
  34. #   examples/oneconn.data examples/rbi.plot examples/rbi2.plot
  35. #   examples/simplecolor.data examples/wire-fusing.grf input.c main.c
  36. #   patchlevel.h psgraph.h psgraph.man psgraph.pro psgsimp.c
  37. #   psgsimp.man
  38. # Wrapped by tp@cognition.pa.dec.com on Mon Sep  7 16:47:34 1992
  39. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  40. if test -f 'LICENSE' -a "${1}" != "-c" ; then 
  41.   echo shar: Will not clobber existing file \"'LICENSE'\"
  42. else
  43. echo shar: Extracting \"'LICENSE'\" \(2100 characters\)
  44. sed "s/^X//" >'LICENSE' <<'END_OF_FILE'
  45. X              Copyright 1989, 1992 Digital Equipment Corporation
  46. X                         All Rights Reserved
  47. X
  48. X
  49. XPermission to use, copy, and modify this software and its documentation is
  50. Xhereby granted only under the following terms and conditions.  Both the above
  51. Xcopyright notice and this permission notice must appear in all copies of the
  52. Xsoftware, derivative works or modified versions, and any portions threof, and
  53. Xboth notices must appear in supporting documentation.
  54. X
  55. XUsers of this software agree to the terms and conditions set forth herein,
  56. Xand hereby grant back to Digital a non-exclusive, unrestricted, royalty-free
  57. Xright and license under any changes, enhancements or extensions made to the
  58. Xcore functions of the software, including but not limited to those affording
  59. Xcompatibility with other hardware or software environments, but excluding
  60. Xapplications which incorporate this software.  Users further agree to use
  61. Xtheir best efforts to return to Digital any such changes, enhancements or
  62. Xextensions that they make and inform Digital of noteworthy uses of this
  63. Xsoftware.  Correspondence should be provided to Digital at:
  64. X
  65. X                      Director of Licensing
  66. X                      Western Research Laboratory
  67. X                      Digital Equipment Corporation
  68. X                      250 University Avenue
  69. X                      Palo Alto, California  94301  
  70. X
  71. XThis software may be distributed (but not offered for sale or transferred
  72. Xfor compensation) to third parties, provided such third parties agree to
  73. Xabide by the terms and conditions of this notice.
  74. X  
  75. XTHE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS
  76. XALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  77. XWARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL
  78. XEQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  79. XCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  80. XUSE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  81. XOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  82. XPERFORMANCE OF THIS SOFTWARE.
  83. END_OF_FILE
  84. if test 2100 -ne `wc -c <'LICENSE'`; then
  85.     echo shar: \"'LICENSE'\" unpacked with wrong size!
  86. fi
  87. # end of 'LICENSE'
  88. fi
  89. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  90.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  91. else
  92. echo shar: Extracting \"'MANIFEST'\" \(871 characters\)
  93. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  94. X   File Name        Archive #    Description
  95. X-----------------------------------------------------------
  96. X LICENSE                    1    
  97. X MANIFEST                   1    
  98. X Makefile                   1    
  99. X README                     1    
  100. X examples                   1    
  101. X examples/Makefile          1    
  102. X examples/README            1    
  103. X examples/distribb.data     1    
  104. X examples/long.plot         2    
  105. X examples/oneconn.data      1    
  106. X examples/rbi.plot          1    
  107. X examples/rbi.txt           3    
  108. X examples/rbi2.plot         1    
  109. X examples/simplecolor.data  1    
  110. X examples/wire-fusing.grf   1    
  111. X grid.c                     2    
  112. X input.c                    1    
  113. X main.c                     1    
  114. X output.c                   2    
  115. X patchlevel.h               1    
  116. X psgraph.h                  1    
  117. X psgraph.man                1    
  118. X psgraph.pro                1    
  119. X psgsimp.c                  1    
  120. X psgsimp.man                1    
  121. END_OF_FILE
  122. if test 871 -ne `wc -c <'MANIFEST'`; then
  123.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  124. fi
  125. # end of 'MANIFEST'
  126. fi
  127. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  128.   echo shar: Will not clobber existing file \"'Makefile'\"
  129. else
  130. echo shar: Extracting \"'Makefile'\" \(2466 characters\)
  131. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  132. X# $Header: Makefile,v 1.4 92/08/04 17:54:59 mogul Locked $
  133. X# $Log:    Makefile,v $
  134. X# Revision 1.4  92/08/04  17:54:59  mogul
  135. X# undo RCS botch
  136. X# 
  137. X# Revision 1.3  1992/07/08  16:51:18  mogul
  138. X# add examples to shar/tar files.
  139. X#
  140. X# Revision 1.2  92/07/08  15:54:17  mogul
  141. X# PROLOG now defined in Makefile
  142. X# 
  143. X# Revision 1.2  92/05/15  14:28:07  mogul
  144. X# PROLOG now defined in Makefile.
  145. X# 
  146. X# Revision 1.1  92/05/14  16:53:33  mogul
  147. X# Initial revision
  148. X# 
  149. X# Revision 1.4  92/03/12  13:44:32  mogul
  150. X# Added psgsimp
  151. X# 
  152. X# Revision 1.3  92/02/21  17:13:41  mogul
  153. X# *** empty log message ***
  154. X# 
  155. X# Revision 1.2  89/01/27  15:53:54  kent
  156. X# Added saber targets and installation.
  157. X# 
  158. X# Revision 1.1  89/01/04  13:57:24  kent
  159. X# Initial revision
  160. X# 
  161. X
  162. XDESTROOT=
  163. X
  164. X# These control where the binaries and manual pages will go
  165. XBINDIR = /usr/local/bin
  166. XMANDIR = /usr/local/man/man1
  167. X
  168. X# This overrides the #define PROLOG in psgraph.h
  169. X# If you change this, you should do a "make clean; make" to
  170. X# ensure that all references are recompiled.
  171. XPROLOGDIR = /usr/local/lib/ps
  172. X
  173. X# Best to leave these two lines alone.
  174. XPROLOGFILE = ${PROLOGDIR}/psgraph.pro
  175. XDEFINES = -DPROLOG=\"${PROLOGFILE}\"
  176. X
  177. XCFLAGS= -O ${DEFINES}
  178. X
  179. XTARGETS = psgraph psgsimp
  180. XOBJS=    main.o grid.o input.o output.o
  181. XSRCS=    main.c grid.c input.c output.c psgsimp.c
  182. X
  183. Xall:    $(TARGETS)
  184. X
  185. Xinstall: $(TARGETS) psgraph.man
  186. X    install -c -s psgraph      ${DESTROOT}/${BINDIR}/
  187. X    install -c -s psgsimp      ${DESTROOT}/${BINDIR}/
  188. X    install -c    psgraph.man ${DESTROOT}/${MANDIR}/psgraph.1
  189. X    install -c    psgsimp.man ${DESTROOT}/${MANDIR}/psgsimp.1
  190. X    install -c    psgraph.pro $(DESTROOT)/${PROLOGFILE}
  191. X
  192. Xclean:
  193. X    rm -f *.o a.out ERRS LINT core ,* ${TARGETS} *.BAK *.CKP
  194. X    rm -f psgraph.shar psgraph.tar psgraph.tar.Z
  195. X
  196. Xpsgraph: $(OBJS)
  197. X    cc -o psgraph $(CFLAGS) $(OBJS) -lm
  198. X
  199. Xpsgsimp: psgsimp.o
  200. X    cc -o psgsimp $(CFLAGS) psgsimp.o -lm
  201. X
  202. Xsaber:
  203. X    #load ${CFLAGS} ${SRCS} -lm
  204. X
  205. Xsaber_o:
  206. X    #load ${CFLAGS} ${OBJS} -lm
  207. X
  208. Xlint:    $(SRCS)
  209. X    lint -c $(SRCS) > LINT
  210. X
  211. XFILES =  README $(SRCS) psgraph.h psgraph.man psgsimp.man \
  212. X    psgraph.pro Makefile LICENSE patchlevel.h
  213. X
  214. XEXAMPLES_TAR = examples
  215. X
  216. XEXAMPLES_SHAR = examples examples/*
  217. X
  218. Xpsgraph.shar: $(FILES) $(EXAMPLES_SHAR)
  219. X    rm -f psgraph.shar
  220. X    shar $(FILES) $(EXAMPLES_SHAR) >psgraph.shar
  221. X
  222. Xpsgraph.tar: $(FILES)  $(EXAMPLES_TAR)
  223. X    rm -f psgraph.tar
  224. X    tar cf psgraph.tar $(FILES) $(EXAMPLES_TAR)
  225. X
  226. Xpsgraph.tar.Z: psgraph.tar
  227. X    rm -f psgraph.tar.Z
  228. X    compress psgraph.tar    
  229. X
  230. Xmain.o:    psgraph.h
  231. Xgrid.o:    psgraph.h
  232. Xinput.o:    psgraph.h
  233. Xoutput.o:    psgraph.h
  234. END_OF_FILE
  235. if test 2466 -ne `wc -c <'Makefile'`; then
  236.     echo shar: \"'Makefile'\" unpacked with wrong size!
  237. fi
  238. # end of 'Makefile'
  239. fi
  240. if test -f 'README' -a "${1}" != "-c" ; then 
  241.   echo shar: Will not clobber existing file \"'README'\"
  242. else
  243. echo shar: Extracting \"'README'\" \(1145 characters\)
  244. sed "s/^X//" >'README' <<'END_OF_FILE'
  245. XREADME for: "psgraph" version of 21 February 1992
  246. X
  247. X"Psgraph" takes input files vaguely like those accepted by graph(1),
  248. Xand produces PostScript output.  The manual page explains the rest.
  249. X
  250. XPsgraph was written by Chris Kent of DECWRL (now Chris Kantarjiev
  251. Xof Xerox PARC), based on some code from Bob Brown of NASA RIACS,
  252. Xand has been hacked on by Brian Reid and Jeff Mogul of DECWRL.
  253. X
  254. XPlease obey the part in the LICENSE file that says not to redistribute
  255. Xthis software to anyone, unless you do it for free and include the
  256. XLICENSE file and all copyright notices.
  257. X
  258. XTo install psgraph, you might have to modify Makefile and psgraph.h
  259. Xto reflect where you want to install the files.  In psgraph.h,
  260. Xthe important line is:
  261. X#define PROLOG  "/usr/local/lib/ps/psgraph.pro"
  262. X
  263. XTo obtain another copy of the code (in case someone updates the
  264. Xcode later on):
  265. X        ftp gatekeeper.dec.com
  266. X        user anonymous
  267. X                <give your name when asked for the password>
  268. X        cd pub/DEC
  269. X        type binary
  270. X        get psgraph.tar.Z
  271. Xthen "uncompress psgraph.tar.Z", cd to an empty directory where
  272. Xyou want to put the sources, and "tar xf psgraph.tar".
  273. END_OF_FILE
  274. if test 1145 -ne `wc -c <'README'`; then
  275.     echo shar: \"'README'\" unpacked with wrong size!
  276. fi
  277. # end of 'README'
  278. fi
  279. if test ! -d 'examples' ; then
  280.     echo shar: Creating directory \"'examples'\"
  281.     mkdir 'examples'
  282. fi
  283. if test -f 'examples/Makefile' -a "${1}" != "-c" ; then 
  284.   echo shar: Will not clobber existing file \"'examples/Makefile'\"
  285. else
  286. echo shar: Extracting \"'examples/Makefile'\" \(612 characters\)
  287. sed "s/^X//" >'examples/Makefile' <<'END_OF_FILE'
  288. X#
  289. X# Makefile to generate PostScript from psgraph examples
  290. X#
  291. X
  292. X# Where to find the psgraph and psgsimp programs
  293. XPSGRAPH = psgraph
  294. XPSGSIMP = psgsimp
  295. X
  296. XPLOTS = rbi.ps rbi2.ps wire-fusing.ps oneconn.ps distribb.ps long.ps \
  297. X    shorter.ps simplecolor.ps
  298. X
  299. X# People like to use different suffixes
  300. X.SUFFIXES: .ps .grf .plot .data
  301. X
  302. X.data.ps:
  303. X    $(PSGRAPH) -P <$*.data >$*.ps
  304. X
  305. X.plot.ps:
  306. X    $(PSGRAPH) -P <$*.plot >$*.ps
  307. X
  308. X.grf.ps:
  309. X    $(PSGRAPH) -P <$*.grf >$*.ps
  310. X
  311. X
  312. Xall: $(PLOTS)
  313. X
  314. Xclean:
  315. X    rm -f $(PLOTS) shorter.plot
  316. X
  317. Xshorter.plot: long.plot Makefile
  318. X    $(PSGSIMP) 0.01 <long.plot |grep -v '^#' >shorter.plot
  319. X    wc long.plot shorter.plot
  320. END_OF_FILE
  321. if test 612 -ne `wc -c <'examples/Makefile'`; then
  322.     echo shar: \"'examples/Makefile'\" unpacked with wrong size!
  323. fi
  324. # end of 'examples/Makefile'
  325. fi
  326. if test -f 'examples/README' -a "${1}" != "-c" ; then 
  327.   echo shar: Will not clobber existing file \"'examples/README'\"
  328. else
  329. echo shar: Extracting \"'examples/README'\" \(726 characters\)
  330. sed "s/^X//" >'examples/README' <<'END_OF_FILE'
  331. XThis directory contains examples of some input files for "psgraph".
  332. XYou should ignore the scientific content of these examples, since
  333. Xthey may be incorrect or even sheer fabrications.
  334. X
  335. XSome examples might look better when printed on a color PostScript
  336. Xprinter, or viewed using a PostScript previewer on a color display.
  337. X
  338. XType "make" to generate a bunch of .ps files.  (You might have to
  339. Xchange the definitions in the Makefile for PSGRAPH and PSGSIMP).
  340. XSome of these might take a long time to print, even on a fast printer.
  341. X
  342. XThe file shorter.plot is automatically generated from long.plot using
  343. Xpsgsimp, to demonstrate how this program can simplify a graph (making
  344. Xit much faster to print) without removing significant detail.
  345. END_OF_FILE
  346. if test 726 -ne `wc -c <'examples/README'`; then
  347.     echo shar: \"'examples/README'\" unpacked with wrong size!
  348. fi
  349. # end of 'examples/README'
  350. fi
  351. if test -f 'examples/distribb.data' -a "${1}" != "-c" ; then 
  352.   echo shar: Will not clobber existing file \"'examples/distribb.data'\"
  353. else
  354. echo shar: Extracting \"'examples/distribb.data'\" \(5498 characters\)
  355. sed "s/^X//" >'examples/distribb.data' <<'END_OF_FILE'
  356. Xx log
  357. Xx intervals 10
  358. X# Plot generated by plotsubs.c
  359. Xx size 6
  360. Xy size 4
  361. Xgrid 2
  362. Xmarker off
  363. Xtransparent
  364. Xline solid
  365. Xy label "Number of connections"
  366. Xx label "Total bytes transferred"
  367. Xbreak
  368. Xline solid
  369. Xlinewidth 3
  370. X1.071286 0
  371. X1.071286 22
  372. Xbreak
  373. Xbreak
  374. Xline solid
  375. Xlinewidth 3
  376. X2.132844 0
  377. X2.132844 2
  378. Xbreak
  379. Xbreak
  380. Xline solid
  381. Xlinewidth 3
  382. X4.873306 0
  383. X4.873306 5
  384. Xbreak
  385. Xbreak
  386. Xline solid
  387. Xlinewidth 3
  388. X7.366410 0
  389. X7.366410 7
  390. Xbreak
  391. Xbreak
  392. Xline solid
  393. Xlinewidth 3
  394. X8.454086 0
  395. X8.454086 1
  396. Xbreak
  397. Xbreak
  398. Xline solid
  399. Xlinewidth 3
  400. X9.702361 0
  401. X9.702361 1
  402. Xbreak
  403. Xbreak
  404. Xline solid
  405. Xlinewidth 3
  406. X12.779060 0
  407. X12.779060 2
  408. Xbreak
  409. Xbreak
  410. Xline solid
  411. Xlinewidth 3
  412. X14.665932 0
  413. X14.665932 14
  414. Xbreak
  415. Xbreak
  416. Xline solid
  417. Xlinewidth 3
  418. X19.316622 0
  419. X19.316622 2
  420. Xbreak
  421. Xbreak
  422. Xline solid
  423. Xlinewidth 3
  424. X22.168787 0
  425. X22.168787 2
  426. Xbreak
  427. Xbreak
  428. Xline solid
  429. Xlinewidth 3
  430. X25.442084 0
  431. X25.442084 4
  432. Xbreak
  433. Xbreak
  434. Xline solid
  435. Xlinewidth 3
  436. X29.198694 0
  437. X29.198694 15
  438. Xbreak
  439. Xbreak
  440. Xline solid
  441. Xlinewidth 3
  442. X33.509981 0
  443. X33.509981 20
  444. Xbreak
  445. Xbreak
  446. Xline solid
  447. Xlinewidth 3
  448. X38.457844 0
  449. X38.457844 22
  450. Xbreak
  451. Xbreak
  452. Xline solid
  453. Xlinewidth 3
  454. X44.136276 0
  455. X44.136276 66
  456. Xbreak
  457. Xbreak
  458. Xline solid
  459. Xlinewidth 3
  460. X50.653147 0
  461. X50.653147 17
  462. Xbreak
  463. Xbreak
  464. Xline solid
  465. Xlinewidth 3
  466. X58.132257 0
  467. X58.132257 3
  468. Xbreak
  469. Xbreak
  470. Xline solid
  471. Xlinewidth 3
  472. X66.715683 0
  473. X66.715683 6
  474. Xbreak
  475. Xbreak
  476. Xline solid
  477. Xlinewidth 3
  478. X76.566482 0
  479. X76.566482 12
  480. Xbreak
  481. Xbreak
  482. Xline solid
  483. Xlinewidth 3
  484. X87.871784 0
  485. X87.871784 22
  486. Xbreak
  487. Xbreak
  488. Xline solid
  489. Xlinewidth 3
  490. X100.846353 0
  491. X100.846353 23
  492. Xbreak
  493. Xbreak
  494. Xline solid
  495. Xlinewidth 3
  496. X115.736661 0
  497. X115.736661 25
  498. Xbreak
  499. Xbreak
  500. Xline solid
  501. Xlinewidth 3
  502. X132.825574 0
  503. X132.825574 14
  504. Xbreak
  505. Xbreak
  506. Xline solid
  507. Xlinewidth 3
  508. X152.437723 0
  509. X152.437723 6
  510. Xbreak
  511. Xbreak
  512. Xline solid
  513. Xlinewidth 3
  514. X174.945672 0
  515. X174.945672 8
  516. Xbreak
  517. Xbreak
  518. Xline solid
  519. Xlinewidth 3
  520. X200.776998 0
  521. X200.776998 16
  522. Xbreak
  523. Xbreak
  524. Xline solid
  525. Xlinewidth 3
  526. X230.422407 0
  527. X230.422407 11
  528. Xbreak
  529. Xbreak
  530. Xline solid
  531. Xlinewidth 3
  532. X264.445061 0
  533. X264.445061 13
  534. Xbreak
  535. Xbreak
  536. Xline solid
  537. Xlinewidth 3
  538. X303.491277 0
  539. X303.491277 63
  540. Xbreak
  541. Xbreak
  542. Xline solid
  543. Xlinewidth 3
  544. X348.302799 0
  545. X348.302799 436
  546. Xbreak
  547. Xbreak
  548. Xline solid
  549. Xlinewidth 3
  550. X399.730896 0
  551. X399.730896 46
  552. Xbreak
  553. Xbreak
  554. Xline solid
  555. Xlinewidth 3
  556. X458.752526 0
  557. X458.752526 14
  558. Xbreak
  559. Xbreak
  560. Xline solid
  561. Xlinewidth 3
  562. X526.488902 0
  563. X526.488902 29
  564. Xbreak
  565. Xbreak
  566. Xline solid
  567. Xlinewidth 3
  568. X604.226785 0
  569. X604.226785 39
  570. Xbreak
  571. Xbreak
  572. Xline solid
  573. Xlinewidth 3
  574. X693.442931 0
  575. X693.442931 35
  576. Xbreak
  577. Xbreak
  578. Xline solid
  579. Xlinewidth 3
  580. X795.832145 0
  581. X795.832145 41
  582. Xbreak
  583. Xbreak
  584. Xline solid
  585. Xlinewidth 3
  586. X913.339477 0
  587. X913.339477 37
  588. Xbreak
  589. Xbreak
  590. Xline solid
  591. Xlinewidth 3
  592. X1048.197167 0
  593. X1048.197167 65
  594. Xbreak
  595. Xbreak
  596. Xline solid
  597. Xlinewidth 3
  598. X1202.967055 0
  599. X1202.967055 42
  600. Xbreak
  601. Xbreak
  602. Xline solid
  603. Xlinewidth 3
  604. X1380.589245 0
  605. X1380.589245 57
  606. Xbreak
  607. Xbreak
  608. Xline solid
  609. Xlinewidth 3
  610. X1584.437957 0
  611. X1584.437957 53
  612. Xbreak
  613. Xbreak
  614. Xline solid
  615. Xlinewidth 3
  616. X1818.385627 0
  617. X1818.385627 36
  618. Xbreak
  619. Xbreak
  620. Xline solid
  621. Xlinewidth 3
  622. X2086.876469 0
  623. X2086.876469 24
  624. Xbreak
  625. Xbreak
  626. Xline solid
  627. Xlinewidth 3
  628. X2395.010899 0
  629. X2395.010899 45
  630. Xbreak
  631. Xbreak
  632. Xline solid
  633. Xlinewidth 3
  634. X2748.642430 0
  635. X2748.642430 25
  636. Xbreak
  637. Xbreak
  638. Xline solid
  639. Xlinewidth 3
  640. X3154.488862 0
  641. X3154.488862 20
  642. Xbreak
  643. Xbreak
  644. Xline solid
  645. Xlinewidth 3
  646. X3620.259905 0
  647. X3620.259905 26
  648. Xbreak
  649. Xbreak
  650. Xline solid
  651. Xlinewidth 3
  652. X4154.803632 0
  653. X4154.803632 6
  654. Xbreak
  655. Xbreak
  656. Xline solid
  657. Xlinewidth 3
  658. X4768.274563 0
  659. X4768.274563 18
  660. Xbreak
  661. Xbreak
  662. Xline solid
  663. Xlinewidth 3
  664. X5472.326571 0
  665. X5472.326571 22
  666. Xbreak
  667. Xbreak
  668. Xline solid
  669. Xlinewidth 3
  670. X6280.334259 0
  671. X6280.334259 10
  672. Xbreak
  673. Xbreak
  674. Xline solid
  675. Xlinewidth 3
  676. X7207.647040 0
  677. X7207.647040 8
  678. Xbreak
  679. Xbreak
  680. Xline solid
  681. Xlinewidth 3
  682. X8271.880716 0
  683. X8271.880716 16
  684. Xbreak
  685. Xbreak
  686. Xline solid
  687. Xlinewidth 3
  688. X9493.252126 0
  689. X9493.252126 1
  690. Xbreak
  691. Xbreak
  692. Xline solid
  693. Xlinewidth 3
  694. X10894.963191 0
  695. X10894.963191 11
  696. Xbreak
  697. Xbreak
  698. Xline solid
  699. Xlinewidth 3
  700. X12503.641678 0
  701. X12503.641678 5
  702. Xbreak
  703. Xbreak
  704. Xline solid
  705. Xlinewidth 3
  706. X14349.847031 0
  707. X14349.847031 5
  708. Xbreak
  709. Xbreak
  710. Xline solid
  711. Xlinewidth 3
  712. X16468.650904 0
  713. X16468.650904 4
  714. Xbreak
  715. Xbreak
  716. Xline solid
  717. Xlinewidth 3
  718. X18900.303398 0
  719. X18900.303398 3
  720. Xbreak
  721. Xbreak
  722. Xline solid
  723. Xlinewidth 3
  724. X21690.997678 0
  725. X21690.997678 3
  726. Xbreak
  727. Xbreak
  728. Xline solid
  729. Xlinewidth 3
  730. X24893.747491 0
  731. X24893.747491 3
  732. Xbreak
  733. Xbreak
  734. Xline solid
  735. Xlinewidth 3
  736. X28569.394240 0
  737. X28569.394240 3
  738. Xbreak
  739. Xbreak
  740. Xline solid
  741. Xlinewidth 3
  742. X32787.762772 0
  743. X32787.762772 7
  744. Xbreak
  745. Xbreak
  746. Xline solid
  747. Xlinewidth 3
  748. X37628.987810 0
  749. X37628.987810 12
  750. Xbreak
  751. Xbreak
  752. Xline solid
  753. Xlinewidth 3
  754. X43185.036242 0
  755. X43185.036242 11
  756. Xbreak
  757. Xbreak
  758. Xline solid
  759. Xlinewidth 3
  760. X49561.454182 0
  761. X49561.454182 5
  762. Xbreak
  763. Xbreak
  764. Xline solid
  765. Xlinewidth 3
  766. X56879.371985 0
  767. X56879.371985 2
  768. Xbreak
  769. Xbreak
  770. Xline solid
  771. Xlinewidth 3
  772. X65277.805319 0
  773. X65277.805319 24
  774. Xbreak
  775. Xbreak
  776. Xline solid
  777. Xlinewidth 3
  778. X74916.295988 0
  779. X74916.295988 4
  780. Xbreak
  781. Xbreak
  782. Xline solid
  783. Xlinewidth 3
  784. X85977.942689 0
  785. X85977.942689 6
  786. Xbreak
  787. Xbreak
  788. Xline solid
  789. Xlinewidth 3
  790. X98672.879265 0
  791. X98672.879265 44
  792. Xbreak
  793. Xbreak
  794. Xline solid
  795. Xlinewidth 3
  796. X113242.266540 0
  797. X113242.266540 3
  798. Xbreak
  799. Xbreak
  800. Xline solid
  801. Xlinewidth 3
  802. X129962.873553 0
  803. X129962.873553 7
  804. Xbreak
  805. Xbreak
  806. Xline solid
  807. Xlinewidth 3
  808. X149152.335238 0
  809. X149152.335238 6
  810. Xbreak
  811. Xbreak
  812. Xline solid
  813. Xlinewidth 3
  814. X171175.186412 0
  815. X171175.186412 6
  816. Xbreak
  817. Xbreak
  818. Xline solid
  819. Xlinewidth 3
  820. X196449.786700 0
  821. X196449.786700 5
  822. Xbreak
  823. Xbreak
  824. Xline solid
  825. Xlinewidth 3
  826. X225456.267951 0
  827. X225456.267951 5
  828. Xbreak
  829. Xbreak
  830. Xline solid
  831. Xlinewidth 3
  832. X258745.655122 0
  833. X258745.655122 3
  834. Xbreak
  835. Xbreak
  836. Xline solid
  837. Xlinewidth 3
  838. X340796.063816 0
  839. X340796.063816 1
  840. Xbreak
  841. Xbreak
  842. Xline solid
  843. Xlinewidth 3
  844. X391115.765362 0
  845. X391115.765362 3
  846. Xbreak
  847. Xbreak
  848. Xline solid
  849. Xlinewidth 3
  850. X448865.342521 0
  851. X448865.342521 1
  852. Xbreak
  853. Xbreak
  854. Xline solid
  855. Xlinewidth 3
  856. X591204.292270 0
  857. X591204.292270 1
  858. Xbreak
  859. Xbreak
  860. Xline solid
  861. Xlinewidth 3
  862. X893654.887257 0
  863. X893654.887257 1
  864. Xbreak
  865. X# NOTE "1098 connections sending zero bytes"
  866. X10 460 "(1098 connections sending zero bytes)"
  867. END_OF_FILE
  868. if test 5498 -ne `wc -c <'examples/distribb.data'`; then
  869.     echo shar: \"'examples/distribb.data'\" unpacked with wrong size!
  870. fi
  871. # end of 'examples/distribb.data'
  872. fi
  873. if test -f 'examples/oneconn.data' -a "${1}" != "-c" ; then 
  874.   echo shar: Will not clobber existing file \"'examples/oneconn.data'\"
  875. else
  876. echo shar: Extracting \"'examples/oneconn.data'\" \(6580 characters\)
  877. sed "s/^X//" >'examples/oneconn.data' <<'END_OF_FILE'
  878. X# Plot generated by plotsubs.c
  879. Xx size 6
  880. Xy size 4
  881. Xgrid 2
  882. Xmarker off
  883. Xtransparent
  884. Xline solid
  885. Xy label "SEQ number (bytes)"
  886. Xx label "time (seconds since start of connection)"
  887. X# line starts
  888. Xbreak
  889. Xcolor black
  890. X0.000000 0.000000
  891. X2.281259 1.000000
  892. X5.630866 1.000000
  893. X8.591328 26.000000
  894. X11.324375 68.000000
  895. X14.007842 104.000000
  896. X14.045660 104.000000
  897. X16.797053 110.000000
  898. X27.143880 110.000000
  899. X27.145650 1570.000000
  900. X27.147066 3030.000000
  901. X27.148296 4490.000000
  902. X27.150135 5950.000000
  903. X27.151365 7410.000000
  904. X27.152595 8870.000000
  905. X27.154005 10330.000000
  906. X27.155235 11790.000000
  907. X27.156996 13250.000000
  908. X27.158226 14710.000000
  909. X27.158635 16170.000000
  910. X31.314444 16494.000000
  911. X31.316334 17954.000000
  912. X31.317564 19414.000000
  913. X31.319414 20874.000000
  914. X31.320644 22334.000000
  915. X31.322923 23794.000000
  916. X31.324153 25254.000000
  917. X31.326110 26714.000000
  918. X31.327704 28174.000000
  919. X31.328934 29634.000000
  920. X31.331024 31094.000000
  921. X31.331345 32554.000000
  922. X35.961998 32878.000000
  923. X35.961998 32878.000000
  924. Xbreak
  925. Xcolor orange
  926. Xmarker x
  927. X35.961998 32878.000000
  928. Xbreak
  929. Xmarker off
  930. Xcolor black
  931. X35.961998 32878.000000
  932. X35.964008 34338.000000
  933. X35.965238 35798.000000
  934. X35.965238 35798.000000
  935. Xbreak
  936. Xcolor orange
  937. Xmarker x
  938. X35.965238 35798.000000
  939. Xbreak
  940. Xmarker off
  941. Xcolor black
  942. X35.965238 35798.000000
  943. X35.967161 37258.000000
  944. X35.967161 37258.000000
  945. Xbreak
  946. Xcolor orange
  947. Xmarker x
  948. X35.967161 37258.000000
  949. Xbreak
  950. Xmarker off
  951. Xcolor black
  952. X35.967161 37258.000000
  953. X35.968391 38718.000000
  954. X35.968391 38718.000000
  955. Xbreak
  956. Xcolor orange
  957. Xmarker x
  958. X35.968391 38718.000000
  959. Xbreak
  960. Xmarker off
  961. Xcolor black
  962. X35.968391 38718.000000
  963. X35.969621 40178.000000
  964. X35.969621 40178.000000
  965. Xbreak
  966. Xcolor orange
  967. Xmarker x
  968. X35.969621 40178.000000
  969. Xbreak
  970. Xmarker off
  971. Xcolor black
  972. X35.969621 40178.000000
  973. X35.970851 41638.000000
  974. X35.970851 41638.000000
  975. Xbreak
  976. Xcolor orange
  977. Xmarker x
  978. X35.970851 41638.000000
  979. Xbreak
  980. Xmarker off
  981. Xcolor black
  982. X35.970851 41638.000000
  983. X35.972523 43098.000000
  984. X35.972523 43098.000000
  985. Xbreak
  986. Xcolor orange
  987. Xmarker x
  988. X35.972523 43098.000000
  989. Xbreak
  990. Xmarker off
  991. Xcolor black
  992. X35.972523 43098.000000
  993. X35.974186 44558.000000
  994. X35.974186 44558.000000
  995. Xbreak
  996. Xcolor orange
  997. Xmarker x
  998. X35.974186 44558.000000
  999. Xbreak
  1000. Xmarker off
  1001. Xcolor black
  1002. X35.974186 44558.000000
  1003. X35.975416 46018.000000
  1004. X35.975416 46018.000000
  1005. Xbreak
  1006. Xcolor orange
  1007. Xmarker x
  1008. X35.975416 46018.000000
  1009. Xbreak
  1010. Xmarker off
  1011. Xcolor black
  1012. X35.975416 46018.000000
  1013. X35.976646 47478.000000
  1014. X35.976646 47478.000000
  1015. Xbreak
  1016. Xcolor orange
  1017. Xmarker x
  1018. X35.976646 47478.000000
  1019. Xbreak
  1020. Xmarker off
  1021. Xcolor black
  1022. X35.976646 47478.000000
  1023. X35.976967 48938.000000
  1024. X35.976967 48938.000000
  1025. Xbreak
  1026. Xcolor orange
  1027. Xmarker x
  1028. X35.976967 48938.000000
  1029. Xbreak
  1030. Xmarker off
  1031. Xcolor black
  1032. X35.976967 48938.000000
  1033. X39.504179 32878.000000
  1034. X39.542276 35798.000000
  1035. X39.544144 37258.000000
  1036. X39.555030 38718.000000
  1037. X39.556906 40178.000000
  1038. X39.562139 41638.000000
  1039. X39.564310 43098.000000
  1040. X39.565540 44558.000000
  1041. X39.568048 46018.000000
  1042. X39.569744 47478.000000
  1043. X39.570174 48938.000000
  1044. X41.920787 49262.000000
  1045. X41.920787 49262.000000
  1046. Xbreak
  1047. Xcolor orange
  1048. Xmarker x
  1049. X41.920787 49262.000000
  1050. Xbreak
  1051. Xmarker off
  1052. Xcolor black
  1053. X41.920787 49262.000000
  1054. X41.922909 50722.000000
  1055. X41.924139 52182.000000
  1056. X41.925879 53642.000000
  1057. X41.927165 55102.000000
  1058. X41.928395 56562.000000
  1059. X42.008235 49262.000000
  1060. X45.069602 58022.000000
  1061. X45.072649 59482.000000
  1062. X45.074249 60942.000000
  1063. X45.152496 62402.000000
  1064. X47.455308 63862.000000
  1065. X50.642708 65322.000000
  1066. X50.651306 65646.000000
  1067. X50.653039 67106.000000
  1068. X50.654904 68566.000000
  1069. X50.657009 70026.000000
  1070. X53.272351 71486.000000
  1071. X53.280078 72946.000000
  1072. X53.312317 74406.000000
  1073. X53.314369 75866.000000
  1074. X53.326965 77326.000000
  1075. X56.005093 78786.000000
  1076. X56.005093 78786.000000
  1077. Xbreak
  1078. Xcolor orange
  1079. Xmarker x
  1080. X56.005093 78786.000000
  1081. Xbreak
  1082. Xmarker off
  1083. Xcolor black
  1084. X56.005093 78786.000000
  1085. X56.007017 80246.000000
  1086. X60.011517 78786.000000
  1087. X60.011517 78786.000000
  1088. Xbreak
  1089. Xcolor orange
  1090. Xmarker x
  1091. X60.011517 78786.000000
  1092. Xbreak
  1093. Xmarker off
  1094. Xcolor black
  1095. X60.011517 78786.000000
  1096. X68.011686 78786.000000
  1097. X71.152442 81706.000000
  1098. X77.783339 81941.000000
  1099. X77.783339 81941.000000
  1100. Xbreak
  1101. Xcolor orange
  1102. Xmarker x
  1103. X77.783339 81941.000000
  1104. Xbreak
  1105. Xmarker off
  1106. Xcolor black
  1107. X77.783339 81941.000000
  1108. X84.016983 81941.000000
  1109. X86.738456 81947.000000
  1110. X97.951407 81947.000000
  1111. X97.953078 81947.000000
  1112. X97.953078 81947.000000
  1113. Xbreak
  1114. Xcolor black
  1115. X97.953078 81947.000000
  1116. Xbreak
  1117. Xcolor black
  1118. Xline dotted
  1119. X# line starts
  1120. Xbreak
  1121. Xcolor black
  1122. X0.000000 0.000000
  1123. X5.624398 0.000000
  1124. X8.576060 25.000000
  1125. X11.317558 67.000000
  1126. X11.321031 67.000000
  1127. X13.941923 103.000000
  1128. X16.363992 109.000000
  1129. X16.766290 109.000000
  1130. X30.143843 1569.000000
  1131. X30.154085 4489.000000
  1132. X30.213839 5949.000000
  1133. X30.220039 8869.000000
  1134. X30.230332 10329.000000
  1135. X30.320517 13249.000000
  1136. X31.242838 14709.000000
  1137. X31.308561 16493.000000
  1138. X34.885817 19413.000000
  1139. Xbreak
  1140. Xcolor blue
  1141. Xmarker plus
  1142. X34.885817 19413.000000
  1143. Xbreak
  1144. Xmarker off
  1145. Xcolor black
  1146. X34.885817 19413.000000
  1147. Xline dashed
  1148. X34.885817 19413.000000
  1149. Xbreak
  1150. Xcolor red
  1151. X34.885817 19413.000000
  1152. X35.052793 22333.000000
  1153. X35.072283 25253.000000
  1154. X35.075551 28173.000000
  1155. X35.077967 31093.000000
  1156. Xbreak
  1157. Xcolor blue
  1158. Xmarker plus
  1159. X35.077967 31093.000000
  1160. Xbreak
  1161. Xmarker off
  1162. Xcolor red
  1163. X35.077967 31093.000000
  1164. Xline dotted
  1165. X35.077967 31093.000000
  1166. Xbreak
  1167. Xcolor black
  1168. X35.077967 31093.000000
  1169. X35.956033 32877.000000
  1170. Xbreak
  1171. Xcolor blue
  1172. Xmarker plus
  1173. X35.956033 32877.000000
  1174. Xbreak
  1175. Xmarker off
  1176. Xcolor black
  1177. X35.956033 32877.000000
  1178. Xline dashed
  1179. X35.956033 32877.000000
  1180. Xbreak
  1181. Xcolor red
  1182. X35.956033 32877.000000
  1183. X39.538765 35797.000000
  1184. X39.551804 37257.000000
  1185. X39.558918 40177.000000
  1186. X39.565607 43097.000000
  1187. X39.574424 46017.000000
  1188. Xbreak
  1189. Xcolor blue
  1190. Xmarker plus
  1191. X39.574424 46017.000000
  1192. Xbreak
  1193. Xmarker off
  1194. Xcolor red
  1195. X39.574424 46017.000000
  1196. Xline dotted
  1197. X39.574424 46017.000000
  1198. Xbreak
  1199. Xcolor black
  1200. X39.574424 46017.000000
  1201. X41.914260 49261.000000
  1202. X41.985781 49261.000000
  1203. X41.992684 49261.000000
  1204. X42.004842 49261.000000
  1205. X42.335840 49261.000000
  1206. X42.896973 49261.000000
  1207. X42.899511 49261.000000
  1208. X42.905829 49261.000000
  1209. X42.977312 49261.000000
  1210. X43.096731 49261.000000
  1211. X45.061872 52181.000000
  1212. X45.066301 55101.000000
  1213. X45.069840 56561.000000
  1214. X45.148837 58021.000000
  1215. X45.400826 58021.000000
  1216. X47.451358 59481.000000
  1217. X47.658570 60941.000000
  1218. X47.984608 63861.000000
  1219. X50.640983 65321.000000
  1220. X53.267567 65645.000000
  1221. X53.275933 67105.000000
  1222. X53.308119 70025.000000
  1223. X53.322972 71485.000000
  1224. X56.000702 74405.000000
  1225. X56.005353 75865.000000
  1226. X56.162186 78785.000000
  1227. X71.150508 81705.000000
  1228. X77.780504 81940.000000
  1229. X86.628141 81946.000000
  1230. X97.950134 81946.000000
  1231. X99.722784 81947.000000
  1232. X99.722784 81947.000000
  1233. X# LABEL "1285"
  1234. Xbreak
  1235. Xcolor black
  1236. X99.722784 81947.000000
  1237. Xbreak
  1238. Xcolor black
  1239. Xline longdashed
  1240. X# line starts
  1241. Xbreak
  1242. Xcolor green
  1243. X0.000000 0.000000
  1244. X3.018948 81947.000000
  1245. Xbreak
  1246. Xcolor green
  1247. X3.018948 81947.000000
  1248. Xbreak
  1249. Xcolor green
  1250. X3.018948 81947.000000 "median ACK-bw = 27144 bytes/sec"
  1251. X# LABEL "median ACK-bw = 27144 bytes/sec"
  1252. Xbreak
  1253. Xcolor green
  1254. X3.018948 81947.000000
  1255. END_OF_FILE
  1256. if test 6580 -ne `wc -c <'examples/oneconn.data'`; then
  1257.     echo shar: \"'examples/oneconn.data'\" unpacked with wrong size!
  1258. fi
  1259. # end of 'examples/oneconn.data'
  1260. fi
  1261. if test -f 'examples/rbi.plot' -a "${1}" != "-c" ; then 
  1262.   echo shar: Will not clobber existing file \"'examples/rbi.plot'\"
  1263. else
  1264. echo shar: Extracting \"'examples/rbi.plot'\" \(177 characters\)
  1265. sed "s/^X//" >'examples/rbi.plot' <<'END_OF_FILE'
  1266. Xline off
  1267. Xgrid halftick
  1268. Xrangeframe
  1269. Xmarker filledcircle
  1270. Xmarkerscale 0.3
  1271. Xx min 0
  1272. Xy min 0
  1273. Xheight 6
  1274. Xwidth 6
  1275. Xtitle "RBI rate year-to-year comparison (corr. = 0.586)"
  1276. X
  1277. Xinclude rbi.txt
  1278. END_OF_FILE
  1279. if test 177 -ne `wc -c <'examples/rbi.plot'`; then
  1280.     echo shar: \"'examples/rbi.plot'\" unpacked with wrong size!
  1281. fi
  1282. # end of 'examples/rbi.plot'
  1283. fi
  1284. if test -f 'examples/rbi2.plot' -a "${1}" != "-c" ; then 
  1285.   echo shar: Will not clobber existing file \"'examples/rbi2.plot'\"
  1286. else
  1287. echo shar: Extracting \"'examples/rbi2.plot'\" \(188 characters\)
  1288. sed "s/^X//" >'examples/rbi2.plot' <<'END_OF_FILE'
  1289. Xline off
  1290. Xgrid halftick
  1291. Xrangeframe
  1292. Xmarker filledcircle
  1293. Xmarkerscale 0.3
  1294. Xx min 0 
  1295. Xy min 0
  1296. Xdataticks
  1297. Xheight 6
  1298. Xwidth 6
  1299. Xtitle "RBI rate year-to-year comparison (corr. = 0.586)"
  1300. X
  1301. Xinclude rbi.txt
  1302. END_OF_FILE
  1303. if test 188 -ne `wc -c <'examples/rbi2.plot'`; then
  1304.     echo shar: \"'examples/rbi2.plot'\" unpacked with wrong size!
  1305. fi
  1306. # end of 'examples/rbi2.plot'
  1307. fi
  1308. if test -f 'examples/simplecolor.data' -a "${1}" != "-c" ; then 
  1309.   echo shar: Will not clobber existing file \"'examples/simplecolor.data'\"
  1310. else
  1311. echo shar: Extracting \"'examples/simplecolor.data'\" \(273 characters\)
  1312. sed "s/^X//" >'examples/simplecolor.data' <<'END_OF_FILE'
  1313. Xtitle "Various color changes"
  1314. Xx max 8
  1315. Xy max 8
  1316. X0 0
  1317. X1 1 "Black text"
  1318. Xcolor red
  1319. X1 1
  1320. X2 2 "Red text"
  1321. Xmarker diamond
  1322. X3 3
  1323. X4 4
  1324. Xmarkergray 25
  1325. X4.5 4.5
  1326. X5 5
  1327. Xcolor green
  1328. X5 5 "Green text next to a gray marker"
  1329. Xcolor red
  1330. Xmarkergray 25
  1331. X5 5
  1332. X6 6
  1333. Xcolor blue
  1334. X6 6
  1335. Xmarkergray 0
  1336. X7 7 "Blue text"
  1337. X
  1338. END_OF_FILE
  1339. if test 273 -ne `wc -c <'examples/simplecolor.data'`; then
  1340.     echo shar: \"'examples/simplecolor.data'\" unpacked with wrong size!
  1341. fi
  1342. # end of 'examples/simplecolor.data'
  1343. fi
  1344. if test -f 'examples/wire-fusing.grf' -a "${1}" != "-c" ; then 
  1345.   echo shar: Will not clobber existing file \"'examples/wire-fusing.grf'\"
  1346. else
  1347. echo shar: Extracting \"'examples/wire-fusing.grf'\" \(2715 characters\)
  1348. sed "s/^X//" >'examples/wire-fusing.grf' <<'END_OF_FILE'
  1349. X# to view: 
  1350. X#   psgraph -P wire-fusing.grf > wire-fusing.ps
  1351. X# for scribe: 
  1352. X#   psgraph wire-fusing.grf > wire-fusing.ps
  1353. X# titlefont "Times-Roman15"
  1354. X# title "Effect of wire length on burnout current for gold bondwire arrays"
  1355. Xwidth 3.4
  1356. Xheight 3.4
  1357. Xcenter 6.8
  1358. Xx log
  1359. Xx font "Times-Roman12"
  1360. Xx label "Bondwire Length (mm)"
  1361. Xy log
  1362. Xy font "Times-Roman12"
  1363. Xy label "Fusing Current per Wire (A)"
  1364. Xfont "Times-Roman11"
  1365. Xmarkerscale 0.5
  1366. Xgrid 2
  1367. Xbreak
  1368. Xbreak
  1369. X# 
  1370. X# set bounds of the graph
  1371. X# marker none
  1372. X# 0.28 0.11
  1373. X# 12.7 3.3
  1374. X# break
  1375. X#
  1376. Xmarker plus
  1377. X6 6.7 "isolated wire"
  1378. X# 2 mil wire
  1379. Xbreak
  1380. X# spline
  1381. X# line solid
  1382. Xline none
  1383. X# 4.32    1.72
  1384. X4.70    1.62
  1385. X5.08    1.55
  1386. X# 5.72    1.52
  1387. X# 6.22    1.40
  1388. X6.60    1.30
  1389. X6.99    1.29
  1390. X7.11    1.37
  1391. X14.63    1.12
  1392. X16.48    1.12
  1393. X3.81    1.85
  1394. X# 4.32    1.64
  1395. X4.88    1.59
  1396. X4.88    1.58
  1397. X5.28    1.625
  1398. X# 5.97    1.440
  1399. X6.35    1.460
  1400. X6.48    1.460
  1401. X6.99    1.39
  1402. X7.24    1.430
  1403. X3.81    1.885
  1404. X4.83    1.72
  1405. X# 5.92    1.590
  1406. X3.81    1.82
  1407. X# 4.52    1.700
  1408. X5.26    1.562
  1409. X# 5.72    1.571
  1410. X6.96    1.390
  1411. X# 4.50    1.68
  1412. X5.28    1.58
  1413. X# 5.92    1.47
  1414. X7.75    1.27
  1415. X3.53    2.42
  1416. X2.92    2.62
  1417. X2.59    2.87
  1418. X2.31    3.38
  1419. X2.24    3.45
  1420. X2.01    3.53
  1421. X1.91    3.85
  1422. X3.66    2.28
  1423. X2.77    2.98
  1424. X2.49    3.00
  1425. X2.44    2.98
  1426. X1.98    3.73
  1427. X1.78    4.37
  1428. X1.37    4.92
  1429. X1.27    5.94
  1430. X1.12    6.30
  1431. X1.73    4.35
  1432. X1.37    5.05
  1433. X1.17    6.53
  1434. Xbreak
  1435. X#
  1436. X#
  1437. Xmarker plus
  1438. X# "isolated wire"
  1439. X# 1 mil wire
  1440. Xbreak
  1441. X# spline
  1442. X# line solid
  1443. X1.85    1.15
  1444. X3.23    .9
  1445. X1.24    1.66
  1446. X1.19    1.71
  1447. X1.12    1.62
  1448. X11.06   .573
  1449. X9.62    .590
  1450. X9.25    .595
  1451. X8.93    .600
  1452. X8.20    .615
  1453. X7.47   .625
  1454. X6.75   .645
  1455. X6.37   .655
  1456. X5.67   .686
  1457. X4.93   .745
  1458. X4.25   .771
  1459. X3.91   .789
  1460. Xbreak
  1461. X#
  1462. X#
  1463. Xmarker circle
  1464. X6 5.193 "3-wire group, 356 micron pitch"
  1465. X# 2 mil wire
  1466. Xbreak
  1467. X# spline
  1468. X# line solid
  1469. X4.22    1.58
  1470. X5.61    1.43
  1471. X5.92    1.38
  1472. Xbreak
  1473. X#
  1474. X#
  1475. Xmarker down
  1476. X6 4.026 "3-wire group, 178 micron pitch"
  1477. X# 2 mil wire
  1478. Xbreak
  1479. X# spline
  1480. X# line solid
  1481. X4.88    1.40
  1482. X6.05    1.23
  1483. X3.95    1.66
  1484. X4.83    1.40
  1485. X5.61    1.27
  1486. X6.27    1.10
  1487. X7.04    1.20
  1488. Xbreak
  1489. X#
  1490. X#
  1491. Xmarker down
  1492. X# "3-wire group, 178 micron pitch"
  1493. X# 1 mil wire
  1494. Xbreak
  1495. X# spline
  1496. X# line solid
  1497. X11.41   .480
  1498. X7.12    .505
  1499. X5.29    .560
  1500. X4.59    .615
  1501. Xbreak
  1502. X#
  1503. X#
  1504. Xmarker square
  1505. X6 3.121 "8-wire group, 178 micron pitch"
  1506. X# 2 mil wire
  1507. Xbreak
  1508. X# spline
  1509. X# line solid
  1510. X1.12    3.10
  1511. X1.60    3.09
  1512. X2.08    2.58
  1513. X2.59    2.35
  1514. X2.59    2.21
  1515. X3.02    2.08
  1516. X3.05    2.08
  1517. X3.07    1.98
  1518. X3.40    1.96
  1519. X3.89    1.83
  1520. X4.3    1.74
  1521. X# 4.47    1.64
  1522. X# 4.52    1.63
  1523. X# 5.33    1.41
  1524. X# 6.02    1.41 
  1525. Xbreak
  1526. X#
  1527. X#
  1528. Xmarker down
  1529. X# "8-wire group, 7 mil pitch"
  1530. X# 1 mil wire
  1531. Xbreak
  1532. X# spline
  1533. X# line solid
  1534. X1.04    1.718
  1535. X1.08    1.806
  1536. X1.58    1.41
  1537. X2.00    1.106
  1538. X2.60     0.881
  1539. X2.67    0.750  
  1540. X# 2.61    0.688
  1541. X3.81    0.638
  1542. Xbreak
  1543. X#
  1544. X#
  1545. Xbreak
  1546. Xmarker none
  1547. Xline dotted
  1548. Xspline
  1549. X# 2 mil wire
  1550. X1.02    9.53
  1551. X12.9    .754
  1552. Xbreak
  1553. X# 1 mil wire
  1554. X1.02    2.38
  1555. X6.83    .356
  1556. Xbreak
  1557. X#
  1558. X#
  1559. Xbreak
  1560. Xmarker none
  1561. Xline dotted
  1562. Xspline
  1563. X# I = const
  1564. X# 2 mil wire
  1565. X17.75    1.067
  1566. X4.31    1.067
  1567. Xbreak
  1568. X# 1 mil wire
  1569. X17.75    .533
  1570. X2.16    .533
  1571. Xbreak
  1572. Xline none
  1573. Xmarker none
  1574. X1.2  .533 "Eqn (11)"
  1575. X6.0 .3 "Eqn (13)"
  1576. X18  1.2 "50.8 micron wire"
  1577. X18  .6 "25.4 micron wire"
  1578. Xbreak
  1579. X#
  1580. END_OF_FILE
  1581. if test 2715 -ne `wc -c <'examples/wire-fusing.grf'`; then
  1582.     echo shar: \"'examples/wire-fusing.grf'\" unpacked with wrong size!
  1583. fi
  1584. # end of 'examples/wire-fusing.grf'
  1585. fi
  1586. if test -f 'input.c' -a "${1}" != "-c" ; then 
  1587.   echo shar: Will not clobber existing file \"'input.c'\"
  1588. else
  1589. echo shar: Extracting \"'input.c'\" \(11313 characters\)
  1590. sed "s/^X//" >'input.c' <<'END_OF_FILE'
  1591. X/* $Header: input.c,v 1.9 92/08/04 17:55:05 mogul Exp $ */
  1592. X
  1593. X/*
  1594. X *               Copyright 1989, 1992 Digital Equipment Corporation
  1595. X *                          All Rights Reserved
  1596. X * 
  1597. X * 
  1598. X * Permission to use, copy, and modify this software and its documentation
  1599. X * is hereby granted only under the following terms and conditions.  Both
  1600. X * the above copyright notice and this permission notice must appear in
  1601. X * all copies of the software, derivative works or modified versions, and
  1602. X * any portions threof, and both notices must appear in supporting
  1603. X * documentation.
  1604. X * 
  1605. X * Users of this software agree to the terms and conditions set forth
  1606. X * herein, and hereby grant back to Digital a non-exclusive, unrestricted,
  1607. X * royalty-free right and license under any changes, enhancements or
  1608. X * extensions made to the core functions of the software, including but
  1609. X * not limited to those affording compatibility with other hardware or
  1610. X * software environments, but excluding applications which incorporate
  1611. X * this software.  Users further agree to use their best efforts to return
  1612. X * to Digital any such changes, enhancements or extensions that they make
  1613. X * and inform Digital of noteworthy uses of this software.  Correspondence
  1614. X * should be provided to Digital at:
  1615. X * 
  1616. X *                       Director of Licensing
  1617. X *                       Western Research Laboratory
  1618. X *                       Digital Equipment Corporation
  1619. X *                       250 University Avenue
  1620. X *                       Palo Alto, California  94301  
  1621. X * 
  1622. X * This software may be distributed (but not offered for sale or
  1623. X * transferred for compensation) to third parties, provided such third
  1624. X * parties agree to abide by the terms and conditions of this notice.
  1625. X * 
  1626. X * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS
  1627. X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  1628. X * WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL
  1629. X * EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  1630. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  1631. X * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1632. X * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1633. X * PERFORMANCE OF THIS SOFTWARE.
  1634. X */
  1635. X
  1636. X/* 
  1637. X * input.c - Read and parse command and data input
  1638. X * 
  1639. X * Author:    Christopher A. Kent
  1640. X *         Western Research Laboratory
  1641. X *         Digital Equipment Corporation
  1642. X * Date:    Wed Jan  4 1989
  1643. X */
  1644. X
  1645. X/*
  1646. X * $Log:    input.c,v $
  1647. X * Revision 1.9  92/08/04  17:55:05  mogul
  1648. X * undo RCS botch
  1649. X * 
  1650. X * Revision 1.8  1992/04/03  23:55:47  kent
  1651. X * Fixed a problem where "include" reset the world.
  1652. X *
  1653. X * Revision 1.7  1992/04/01  23:27:34  kent
  1654. X * Added datalabel verb, fixed a bug in handling blank input lines.
  1655. X *
  1656. X * Revision 1.6  1992/03/31  23:13:12  kent
  1657. X * Added "dataticks" verb.
  1658. X *
  1659. X * Revision 1.5  1992/03/31  02:31:34  kent
  1660. X * Added markergray verb and fixed inverted gray values.
  1661. X *
  1662. X * Revision 1.4  1992/03/31  00:21:29  kent
  1663. X * Added "include" verb
  1664. X *
  1665. X * Revision 1.3  1992/03/31  00:07:39  kent
  1666. X * Added markerscale verb.
  1667. X *
  1668. X * Revision 1.2  1992/03/30  23:33:47  kent
  1669. X * Added halfopen, halfticks grid styles, range frames, and gray.
  1670. X *
  1671. X * Revision 1.1  1992/03/20  21:25:43  kent
  1672. X * Initial revision
  1673. X *
  1674. X * Revision 1.7  92/02/21  17:13:21  mogul
  1675. X * Added Digital license info
  1676. X * 
  1677. X * Revision 1.6  90/12/11  20:41:26  reid
  1678. X * Added code to parse input for new "color" and "linewidth" commands
  1679. X * 
  1680. X * Revision 1.5  89/01/10  18:19:57  kent
  1681. X * Moved marker code to prolog, added error checking and messages.
  1682. X * 
  1683. X * Revision 1.4  89/01/09  22:18:41  kent
  1684. X * Added log scales.
  1685. X * 
  1686. X * Revision 1.3  89/01/04  17:30:27  kent
  1687. X * Made command line arguments override compiled-in defaults for
  1688. X * all plots in a run, not just the first one. 
  1689. X * 
  1690. X * Revision 1.2  89/01/04  15:22:03  kent
  1691. X * Massive renaming. No functional change.
  1692. X * 
  1693. X * Revision 1.1  89/01/04  13:57:49  kent
  1694. X * Initial revision
  1695. X * 
  1696. X */
  1697. X
  1698. Xstatic char rcs_ident[] = "$Header: input.c,v 1.9 92/08/04 17:55:05 mogul Exp $";
  1699. X
  1700. X#include <stdio.h>
  1701. X
  1702. X#include "psgraph.h"
  1703. X
  1704. X/*
  1705. X * Read the input consisting of both numeric and text data.  An array, Token[*]
  1706. X * is built by this routine containing both numeric (type==POINT) and non-numeric
  1707. X * data.  Only the commands that take affect at a point relative to their
  1708. X * appearence in the input are placed in the Token array.  All others just
  1709. X * affect global data.
  1710. X */
  1711. X
  1712. Xdoinput(s)
  1713. X    FILE *s;
  1714. X{
  1715. X    char *argv[ARGC];
  1716. X    int argc;
  1717. X    char buf[BUFSIZ], cmd[BUFSIZ];
  1718. X
  1719. X    for(;;) {
  1720. X        if ( NumTokens >= SizeofToken ) {
  1721. X            SizeofToken += TOKENINC;
  1722. X            Token = (token_t *)realloc((char *)Token,(unsigned)(SizeofToken*sizeof(token_t)));
  1723. X        }
  1724. X        if( fgets(buf, BUFSIZ, s) == NULL )
  1725. X            break;
  1726. X        if ( strlen(buf)==0 || *buf=='#' || buf[0]=='\n')
  1727. X            continue;
  1728. X        strcpy(cmd,buf);
  1729. X        parse(cmd,&argc,argv);
  1730. X#ifdef DEBUG
  1731. X        if ( Debug ) {
  1732. X            fprintf(stderr,"argc=%d, ",argc);
  1733. X            fprintf(stderr,"input=%s\n",buf);
  1734. X        }
  1735. X#endif
  1736. X        if ( isalpha(argv[0][0]) ) {
  1737. X            if ( docmd(argc,argv) )
  1738. X                fprintf(stderr,"Error in input: %s\n",buf);
  1739. X        } else {
  1740. X            Token[NumTokens].type = POINT;
  1741. X            Token[NumTokens].xval = atof(argv[0]);
  1742. X            Token[NumTokens].yval = 0.0;
  1743. X            if ( argc > 1 ) Token[NumTokens].yval = atof(argv[1]);
  1744. X            if ( argc > 2 )
  1745. X                Token[NumTokens].label = newstr(argv[2]);
  1746. X            else
  1747. X                Token[NumTokens].label = NULL;
  1748. X            NumTokens++;
  1749. X        }
  1750. X    }
  1751. X}
  1752. X
  1753. Xdocmd(argc,argv)
  1754. Xint argc;
  1755. Xchar *argv[];
  1756. X{
  1757. X        FILE *f;
  1758. X    
  1759. X    if ( strcmp(argv[0],"break")==0 ) {
  1760. X        Token[NumTokens].type = BREAK;
  1761. X        NumTokens++;
  1762. X    } else if ( strcmp(argv[0],"include")==0 ) {
  1763. X            if ( argc > 1 ) {
  1764. X            f = fopen(argv[1], "r");
  1765. X            if (f != NULL)
  1766. X            doinput(f);
  1767. X        }
  1768. X    } else if ( strcmp(argv[0],"line")==0 ) {
  1769. X        Token[NumTokens].type = LINETYPE;
  1770. X        if ( argc > 1 )
  1771. X            Token[NumTokens].label = newstr(argv[1]);
  1772. X        else
  1773. X            Token[NumTokens].label = NULL;
  1774. X        NumTokens++;
  1775. X    } else if ( strcmp(argv[0],"color")==0 ) {
  1776. X        Token[NumTokens].type = LINECOLOR;
  1777. X        if ( argc > 1 )
  1778. X            Token[NumTokens].label = newstr(argv[1]);
  1779. X        else
  1780. X            Token[NumTokens].label = NULL;
  1781. X        NumTokens++;
  1782. X    } else if ( strcmp(argv[0],"linewidth")==0 ) {
  1783. X        Token[NumTokens].type = LINEWIDTH;
  1784. X        if ( argc > 1 )
  1785. X            Token[NumTokens].label = newstr(argv[1]);
  1786. X        else
  1787. X            Token[NumTokens].label = "0.6";
  1788. X        NumTokens++;
  1789. X    } else if ( strcmp(argv[0],"spline")==0 ) {
  1790. X        Token[NumTokens].type = SPLINE;
  1791. X        NumTokens++;
  1792. X    } else if ( strcmp(argv[0],"label")==0 )
  1793. X        DoAxisLabels = TRUE;
  1794. X    else if ( strcmp(argv[0],"nolabel")==0 )
  1795. X        DoAxisLabels = FALSE;
  1796. X    else if ( strcmp(argv[0],"transparent")==0 ) {
  1797. X        Token[NumTokens].type = TRANS;
  1798. X        Token[NumTokens].ival = TRUE;
  1799. X        NumTokens++;
  1800. X    } else if ( strcmp(argv[0],"notransparent")==0 ) {
  1801. X        Token[NumTokens].type = TRANS;
  1802. X        Token[NumTokens].ival = FALSE;
  1803. X        NumTokens++;
  1804. X    } else if ( strcmp(argv[0],"grid")==0 ) {
  1805. X        Xaxis.gridtype = Yaxis.gridtype = gridval(argv[1]);
  1806. X        if (Xaxis.gridtype == HALFOPEN) {
  1807. X            Xaxis.gridtype = Yaxis.gridtype = OPEN;
  1808. X            Xaxis.halfgrid = Yaxis.halfgrid = TRUE;
  1809. X        }
  1810. X        if (Xaxis.gridtype == HALFTICKS) {
  1811. X            Xaxis.gridtype = Yaxis.gridtype = TICKS;
  1812. X            Xaxis.halfgrid = Yaxis.halfgrid = TRUE;
  1813. X        }
  1814. X    } else if ( strncmp(argv[0],"datatick",8)==0 ) {
  1815. X            Xaxis.datatick = Yaxis.datatick = TRUE;
  1816. X    } else if ( strncmp(argv[0],"datalabel",9)==0 ) {
  1817. X            Xaxis.datalabel = Yaxis.datalabel = TRUE;
  1818. X    } else if ( strcmp(argv[0],"tickgray")==0 )
  1819. X        Xaxis.tickgray = Yaxis.tickgray = 1.0 - atof(argv[1])/100.0;
  1820. X    else if ( strcmp(argv[0],"axisgray")==0 )
  1821. X        Xaxis.axisgray = Yaxis.axisgray = 1.0 - atof(argv[1])/100.0;
  1822. X    else if ( strcmp(argv[0],"title")==0 ) {
  1823. X          if (argc > 1) 
  1824. X            Title.title = newstr(argv[1]);
  1825. X        else 
  1826. X            Title.title = "";
  1827. X    } else if ( strcmp(argv[0],"titlefont")==0 )
  1828. X        Title.font = newstr(argv[1]);
  1829. X    else if ( strncmp(argv[0],"tick", 4)==0 ) {
  1830. X        TickLen = Tick2Len = atof(argv[1]);
  1831. X        if ( argc > 2 )
  1832. X            Tick2Len = atof(argv[2]);
  1833. X    } else if ( strcmp(argv[0], "clip")==0 ) {
  1834. X        if ( argc > 1 )
  1835. X            ClipDist = atof(argv[1]);
  1836. X    } else if ( strcmp(argv[0],"width")==0 )
  1837. X        Xaxis.size = atof(argv[1]);
  1838. X    else if ( strcmp(argv[0],"height")==0 )
  1839. X        Yaxis.size = atof(argv[1]);
  1840. X    else if ( strcmp(argv[0],"rangeframe")==0 )
  1841. X            Xaxis.rangeframe = Yaxis.rangeframe = TRUE;
  1842. X    else if ( strcmp(argv[0],"center")==0 )
  1843. X        Xcenter = atof(argv[1]);
  1844. X    else if ( strcmp(argv[0],"marker")==0 ) {
  1845. X        if ( argc > 1 ) {
  1846. X            Token[NumTokens].type = MARKER;
  1847. X            Token[NumTokens].label = newstr(argv[1]);
  1848. X            NumTokens++;
  1849. X        }
  1850. X    } else if ( strcmp(argv[0],"markerscale")==0 ) {
  1851. X            if ( argc > 1 ) {
  1852. X            Token[NumTokens].type = MARKERSCALE;
  1853. X            Token[NumTokens].val[0] = atof(argv[1]);
  1854. X            NumTokens++;
  1855. X        }
  1856. X    } else if ( strcmp(argv[0],"markergray")==0 ) {
  1857. X            if ( argc > 1 ) {
  1858. X            Token[NumTokens].type = MARKERGRAY;
  1859. X            Token[NumTokens].val[0] = 1.0 - atof(argv[1])/100.0;
  1860. X            NumTokens++;
  1861. X        }
  1862. X    } else if ( strcmp(argv[0],"x")==0 )
  1863. X        return domods(argc, argv, &Xaxis);
  1864. X    else if ( strcmp(argv[0],"y")==0 )
  1865. X        return domods(argc, argv, &Yaxis);
  1866. X    else if ( strcmp(argv[0],"font")==0 ) {
  1867. X        Token[NumTokens].type = FONT;
  1868. X        if (argc > 1)
  1869. X            Token[NumTokens].label = newstr(argv[1]);
  1870. X        else
  1871. X            Token[NumTokens].label = NULL;
  1872. X        NumTokens++;
  1873. X    } else
  1874. X        return TRUE;
  1875. X    return FALSE;
  1876. X}
  1877. X/*
  1878. X * domods - parse and handle input lines for making modifications to
  1879. X * x & y argument structure.
  1880. X *
  1881. X * The input lines handled by this module are
  1882. X *
  1883. X *    x options
  1884. X *
  1885. X * where "options" is one or more of the following
  1886. X *
  1887. X *    intervals N
  1888. X *    log
  1889. X *    min N
  1890. X *    max N
  1891. X *    rangeframe
  1892. X *    step N
  1893. X *    tick N
  1894. X *    size N
  1895. X *    offset N
  1896. X *    label "foo"
  1897. X *    grid {none,open,ticks,full,halfopen,halfticks}
  1898. X *    words
  1899. X *    font "foo"
  1900. X */
  1901. X
  1902. Xdomods(argc, argv, p)
  1903. Xint argc;
  1904. Xchar *argv[];
  1905. Xaxis_t *p;
  1906. X{
  1907. X    int arg;
  1908. X    for ( arg=1 ; arg<argc ; arg++ ) {
  1909. X        if (strcmp(argv[arg], "intervals") == 0)
  1910. X            p->intervals = atoi(argv[++arg]);
  1911. X        else if ( strcmp(argv[arg],"log")==0 )
  1912. X            p->tform = LOG10;
  1913. X        else if ( strcmp(argv[arg],"min")==0 ) {
  1914. X            p->minflag = TRUE;
  1915. X            p->gmin = atof(argv[++arg]);
  1916. X        } else if ( strcmp(argv[arg],"max")==0 ) {
  1917. X            p->maxflag = TRUE;
  1918. X            p->gmax = atof(argv[++arg]);
  1919. X        } else if ( strcmp(argv[arg],"step")==0 ) {
  1920. X            p->distf = TRUE;
  1921. X            p->dist = atof(argv[++arg]);
  1922. X        } else if ( strncmp(argv[arg],"tick",4)==0 ) {
  1923. X            p->tickflag = TRUE;
  1924. X            p->tick = atof(argv[++arg]);
  1925. X        } else if ( strcmp(argv[arg],"rangeframe")==0 ) {
  1926. X                p->rangeframe = TRUE;
  1927. X        } else if ( strcmp(argv[arg],"offset")==0 ) {
  1928. X            p->offset = atof(argv[++arg]);
  1929. X        } else if ( strcmp(argv[arg],"label")== 0 ) {
  1930. X            p->label = newstr(argv[++arg]);
  1931. X        } else if ( strcmp(argv[arg],"font")== 0 ) {
  1932. X            p->font = newstr(argv[++arg]);
  1933. X        } else if ( strcmp(argv[arg],"size")== 0 ) {
  1934. X            p->size = atof(argv[++arg]);
  1935. X        } else if ( strcmp(argv[arg],"grid")==0 ) {
  1936. X            p->gridtype = gridval(argv[++arg]);
  1937. X            if (p->gridtype == HALFOPEN) { /* hack hack */
  1938. X                p->gridtype = OPEN;
  1939. X                p->halfgrid = TRUE;
  1940. X            }
  1941. X            if (p->gridtype == HALFTICKS) {
  1942. X                p->gridtype = TICKS;
  1943. X                p->halfgrid = TRUE;
  1944. X            }
  1945. X        } else if ( strncmp(argv[0],"datatick",8)==0 ) {
  1946. X                p->datatick = TRUE;
  1947. X        } else if ( strncmp(argv[0],"datalabel",9)==0 ) {
  1948. X                p->datalabel = TRUE;
  1949. X        } else if ( strcmp(argv[0],"tickgray")==0 )
  1950. X                p->tickgray =  1.0 - atof(argv[++arg])/100.0;
  1951. X        else if ( strcmp(argv[0],"axisgray")==0 )
  1952. X                p->axisgray = 1.0 - atof(argv[++arg])/100.0;
  1953. X        else
  1954. X            return TRUE;
  1955. X    }
  1956. X    return FALSE;
  1957. X}
  1958. X
  1959. END_OF_FILE
  1960. if test 11313 -ne `wc -c <'input.c'`; then
  1961.     echo shar: \"'input.c'\" unpacked with wrong size!
  1962. fi
  1963. # end of 'input.c'
  1964. fi
  1965. if test -f 'main.c' -a "${1}" != "-c" ; then 
  1966.   echo shar: Will not clobber existing file \"'main.c'\"
  1967. else
  1968. echo shar: Extracting \"'main.c'\" \(15465 characters\)
  1969. sed "s/^X//" >'main.c' <<'END_OF_FILE'
  1970. X/* $Header: main.c,v 1.9 92/08/04 17:55:08 mogul Exp $ */
  1971. X/*
  1972. X *               Copyright 1989, 1992 Digital Equipment Corporation
  1973. X *                          All Rights Reserved
  1974. X * 
  1975. X * 
  1976. X * Permission to use, copy, and modify this software and its documentation
  1977. X * is hereby granted only under the following terms and conditions.  Both
  1978. X * the above copyright notice and this permission notice must appear in
  1979. X * all copies of the software, derivative works or modified versions, and
  1980. X * any portions threof, and both notices must appear in supporting
  1981. X * documentation.
  1982. X * 
  1983. X * Users of this software agree to the terms and conditions set forth
  1984. X * herein, and hereby grant back to Digital a non-exclusive, unrestricted,
  1985. X * royalty-free right and license under any changes, enhancements or
  1986. X * extensions made to the core functions of the software, including but
  1987. X * not limited to those affording compatibility with other hardware or
  1988. X * software environments, but excluding applications which incorporate
  1989. X * this software.  Users further agree to use their best efforts to return
  1990. X * to Digital any such changes, enhancements or extensions that they make
  1991. X * and inform Digital of noteworthy uses of this software.  Correspondence
  1992. X * should be provided to Digital at:
  1993. X * 
  1994. X *                       Director of Licensing
  1995. X *                       Western Research Laboratory
  1996. X *                       Digital Equipment Corporation
  1997. X *                       250 University Avenue
  1998. X *                       Palo Alto, California  94301  
  1999. X * 
  2000. X * This software may be distributed (but not offered for sale or
  2001. X * transferred for compensation) to third parties, provided such third
  2002. X * parties agree to abide by the terms and conditions of this notice.
  2003. X * 
  2004. X * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS
  2005. X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  2006. X * WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL
  2007. X * EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  2008. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  2009. X * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  2010. X * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  2011. X * PERFORMANCE OF THIS SOFTWARE.
  2012. X */
  2013. X
  2014. X/* 
  2015. X * main.c - produce PostScript graphs
  2016. X * 
  2017. X * Author:    Christopher A. Kent
  2018. X *         Western Research Laboratory
  2019. X *         Digital Equipment Corporation
  2020. X * Date:    Wed Jan  4 1989
  2021. X */
  2022. X
  2023. X/*
  2024. X * $Log:    main.c,v $
  2025. X * Revision 1.9  92/08/04  17:55:08  mogul
  2026. X * undo RCS botch
  2027. X * 
  2028. X * Revision 1.8  1992/06/17  22:14:41  kent
  2029. X * Make axis specs with max < min work, fix some bugs with centering
  2030. X * and multiple args.
  2031. X *
  2032. X * Revision 1.7  1992/04/03  23:55:47  kent
  2033. X * Fixed a problem where "include" reset the world.
  2034. X *
  2035. X * Revision 1.6  1992/04/01  23:27:34  kent
  2036. X * Added datalabel verb, fixed a bug in handling blank input lines.
  2037. X *
  2038. X * Revision 1.5  1992/04/01  00:38:24  kent
  2039. X * Fixed a problem with half grids specified with -g.
  2040. X *
  2041. X * Revision 1.4  1992/03/31  02:31:34  kent
  2042. X * Added markergray verb and fixed inverted gray values.
  2043. X *
  2044. X * Revision 1.3  1992/03/31  00:21:29  kent
  2045. X * Added "include" verb
  2046. X *
  2047. X * Revision 1.2  1992/03/30  23:33:47  kent
  2048. X * Added halfopen, halfticks grid styles, range frames, and gray.
  2049. X *
  2050. X * Revision 1.1  1992/03/20  21:25:43  kent
  2051. X * Initial revision
  2052. X *
  2053. X * Revision 1.12  92/02/21  17:13:22  mogul
  2054. X * Added Digital license info
  2055. X * 
  2056. X * Revision 1.11  91/12/19  16:00:52  mogul
  2057. X * Avoid an infinite loop if the graph is a horizontal or vertical
  2058. X * line.
  2059. X * 
  2060. X * Revision 1.10  91/02/04  16:48:01  mogul
  2061. X * Fixed text, marker colors
  2062. X * 
  2063. X * Revision 1.9  90/12/11  20:39:42  reid
  2064. X * Added default values for LineColor and LineWidth
  2065. X * 
  2066. X * Revision 1.8  89/02/03  09:33:06  kent
  2067. X * Use floor in calculating log limits.
  2068. X * 
  2069. X * Revision 1.7  89/01/10  18:19:59  kent
  2070. X * Moved marker code to prolog, added error checking and messages.
  2071. X * 
  2072. X * Revision 1.6  89/01/09  22:18:43  kent
  2073. X * Added log scales.
  2074. X * 
  2075. X * Revision 1.5  89/01/04  18:12:19  kent
  2076. X * Added -p flag to specify alternate prologue file.
  2077. X * 
  2078. X * Revision 1.4  89/01/04  17:57:36  kent
  2079. X * Moved font stuff from main.c to output.c.
  2080. X * newfont() sets PS fontsize variable so white background is the right size.
  2081. X * 
  2082. X * Revision 1.3  89/01/04  17:30:29  kent
  2083. X * Made command line arguments override compiled-in defaults for
  2084. X * all plots in a run, not just the first one. 
  2085. X * 
  2086. X * Revision 1.2  89/01/04  15:22:05  kent
  2087. X * Massive renaming. No functional change.
  2088. X * 
  2089. X * Revision 1.1  89/01/04  13:57:54  kent
  2090. X * Initial revision
  2091. X * 
  2092. X */
  2093. X
  2094. Xstatic char rcs_ident[] = "$Header: main.c,v 1.9 92/08/04 17:55:08 mogul Exp $";
  2095. X
  2096. X/*
  2097. X * This program has a long history. It started out as a program to take
  2098. X * graph(1) input and produce pic/troff output. That was done by Bob Brown. In
  2099. X * the process, he added to the input language to make it a lot more useful.
  2100. X * Chris Kent then took it and made it produce PostScript. As it got more use,
  2101. X * Chris' users didn't care about troff, so that code all went away, but they
  2102. X * wanted even more features.
  2103. X *
  2104. X * This incarnation was started when Chris was asked to add "one more feature"
  2105. X * and the single-file version just got to be too much to handle. Now it's
  2106. X * broken into several files, and the effects of time and feeping creaturism
  2107. X * have been cleaned up. But it almost certainly retains some code from some of
  2108. X * these versions:
  2109. X *
  2110. X *  Bob Brown/RIACS/NASA Ames
  2111. X *  Mostly untested. 3/86
  2112. X *  Converted to emit PostScript instead of Pic
  2113. X *        Chris Kent, DECWRL, 5/87
  2114. X *  More PostScript cleanup -- cak 11/87
  2115. X *  A few new options, made it use a private dictionary, attacked some
  2116. X *    roundoff problems -- cak 2/88
  2117. X *
  2118. X */
  2119. X
  2120. X#include <stdio.h>
  2121. X#include <pwd.h>
  2122. X#include <sys/file.h>
  2123. X
  2124. X#include "psgraph.h"
  2125. X
  2126. Xmain(argc,argv)
  2127. Xchar *argv[];
  2128. X{
  2129. X    int    i;
  2130. X    long    clock;
  2131. X    char    hostname[256];
  2132. X    struct passwd    *pwd;
  2133. X    fontName_t    *fp;
  2134. X    
  2135. X    MinX = MinY = MaxX = MaxY = 0.0;
  2136. X    Token = (token_t *) calloc(TOKENINC, sizeof(token_t));
  2137. X    SizeofToken = TOKENINC;
  2138. X    procargs(argc,argv);
  2139. X
  2140. X    FontList = (fontName_t *) malloc(sizeof (fontName_t));
  2141. X    FontList->name = newstr("Times-Roman");
  2142. X    FontList->next = (fontName_t *) NULL;
  2143. X
  2144. X    /* put out comment header */
  2145. X    printf("%%!PS-Adobe-1.0\n");
  2146. X    pwd = getpwuid(getuid());
  2147. X    gethostname(hostname, sizeof hostname);
  2148. X    printf("%%%%Creator: %s:%s (%s)\n",hostname,
  2149. X        pwd->pw_name, pwd->pw_gecos);
  2150. X    printf("%%%%Title: PostScript graph file\n");
  2151. X    printf("%%%%CreationDate: %s",(time(&clock), ctime(&clock)));
  2152. X    printf("%%%%DocumentFonts: (atend)\n");
  2153. X    printf("%%%%Pages: (atend)\n");
  2154. X    printf("%%%%BoundingBox: (atend)\n");
  2155. X    printf("%%%%EndComments\n");
  2156. X    
  2157. X    /* interpolate prolog and fixed header routines */
  2158. X    
  2159. X    if (copyFile(Prolog, stdout) < 0) {
  2160. X        perror(Prolog);
  2161. X        exit(1);
  2162. X    }
  2163. X    printf("%%%%EndProlog\n");
  2164. X    
  2165. X    if ( Files==0 ) {
  2166. X        process();
  2167. X    } else {
  2168. X        for ( i=0 ; i<Files ; i++ ) {
  2169. X            if ( freopen(File[i],"r", stdin)==NULL )
  2170. X                perror(File[i]);
  2171. X            else
  2172. X                process();
  2173. X        }
  2174. X    }
  2175. X    printf("%%%%Trailer\n");
  2176. X    printf("EndPSGraph\n");
  2177. X    printf("%%%%DocumentFonts: %s", FontList->name);
  2178. X    for (fp = FontList->next; fp; fp = fp->next)
  2179. X        printf(", %s", fp->name);
  2180. X    printf("\n");
  2181. X    printf("%%%%Pages: %d\n", CurrentPage);
  2182. X    printf("%%%%BoundingBox: %d %d %d %d\n",
  2183. X        (int) (MinX * 72), (int) (MinY * 72),
  2184. X        (int) (MaxX * 72), (int) (MaxY * 72));
  2185. X    exit(0);
  2186. X}
  2187. X
  2188. XcopyFile(fileName, stream)
  2189. Xchar    *fileName;
  2190. XFILE    *stream;
  2191. X{
  2192. X    int    fd, fo;
  2193. X    char    buf[BUFSIZ];
  2194. X    int    cnt;
  2195. X
  2196. X    fflush(stream);
  2197. X    fo = fileno(stream);
  2198. X    if ((fd = open(fileName, O_RDONLY, 0)) < 0) 
  2199. X        return -1;
  2200. X    do if (cnt = read(fd, buf, sizeof(buf)))
  2201. X        if (write(fo, buf, cnt) != cnt) return -2;
  2202. X    while (cnt == sizeof(buf));
  2203. X    close(fd);
  2204. X    fflush(stream);
  2205. X    return 0;
  2206. X}
  2207. X
  2208. Xprocess()
  2209. X{
  2210. X    /* reset everything */
  2211. X    init(&Xaxis);
  2212. X    init(&Yaxis);
  2213. X
  2214. X    /* copy command line defaults into place... */
  2215. X    BreakAfterLabel = Args.breakAfterLabel;
  2216. X    Xcenter = Args.center;
  2217. X    Xaxis.size = Width;
  2218. X    Yaxis.size = Height;
  2219. X    Xaxis.offset = Xoffset;
  2220. X    Yaxis.offset = Yoffset;
  2221. X    copyLimit(&Xaxis, &Xlim);
  2222. X    copyLimit(&Yaxis, &Ylim);
  2223. X
  2224. X    /* reset state */
  2225. X    DoAxisLabels = TRUE;
  2226. X    TransparentLabels = FALSE;
  2227. X    UseSpline = FALSE;
  2228. X    NumTokens = 0;
  2229. X    ClipDist = 0.05;
  2230. X    LineType = "solid";
  2231. X    LineColor = "black";
  2232. X    LineWidth = "0.6";
  2233. X    TickLen = 0.1;
  2234. X    Tick2Len = 0.05;
  2235. X    UseMarker = NULL;
  2236. X    TextColor = "black";
  2237. X    MarkColor = "black";
  2238. X    NumTokens = 0;
  2239. X    doinput(stdin);
  2240. X    if ( numpnts() > 0 ) {
  2241. X        transpose();
  2242. X        dolimits(0);
  2243. X        dolimits(1);
  2244. X        doplot();
  2245. X    }
  2246. X}
  2247. X
  2248. Xinit(p)
  2249. Xaxis_t *p;
  2250. X{
  2251. X    p->tickflag = FALSE;
  2252. X    p->label = NULL;
  2253. X    p->gridtype = GridType;
  2254. X    p->tickgray = 0.0;
  2255. X    p->axisgray = 0.0;
  2256. X    p->datatick = FALSE;
  2257. X    p->datalabel = FALSE;
  2258. X    p->halfgrid = HalfGrid;
  2259. X    p->rangeframe = FALSE;
  2260. X    p->intervals = 0;
  2261. X}
  2262. X
  2263. XinitLimit(l)
  2264. Xlimit_t    *l;
  2265. X{
  2266. X    l->minflag = FALSE;
  2267. X    l->maxflag = FALSE;
  2268. X    l->distf = FALSE;
  2269. X    l->tform = IDENT;
  2270. X}
  2271. X
  2272. XcopyLimit(a, l)
  2273. Xaxis_t    *a;
  2274. Xlimit_t    *l;
  2275. X{
  2276. X    a->tform   = l->tform;
  2277. X    a->minflag = l->minflag;
  2278. X    a->maxflag = l->maxflag;
  2279. X    a->distf   = l->distf;
  2280. X    a->min     = l->min;
  2281. X    a->max     = l->max;
  2282. X    a->dist    = l->dist;
  2283. X}
  2284. X
  2285. Xprocargs(argc, argv)
  2286. Xint argc;
  2287. Xchar *argv[];
  2288. X{
  2289. X    int arg, more;
  2290. X    char *swptr;
  2291. X
  2292. X    Files = 0;
  2293. X    File = (char **)calloc(argc, sizeof (char *));
  2294. X    Args.breakAfterLabel = FALSE;
  2295. X    Args.center = 0.0;
  2296. X    GridType = FULL;
  2297. X    HalfGrid = FALSE;
  2298. X    Height = 6.5;
  2299. X    Width = 6.5;
  2300. X    Prolog = PROLOG;
  2301. X    Title.title = NULL;
  2302. X    Title.font = NULL;
  2303. X    Xoffset = 0.0;
  2304. X    Yoffset = 0.0;
  2305. X    TransposeAxes = FALSE;
  2306. X
  2307. X    for ( arg=1 ; arg<argc ; arg++ ) {
  2308. X        if ( argv[arg][0] == '-' ) {
  2309. X            more = 1;
  2310. X            swptr = &argv[arg][1];
  2311. X            while ( more && *swptr!='\0' ) {
  2312. X                switch ( *swptr++ ) {
  2313. X                case 'b':    /*breaks*/
  2314. X                    Args.breakAfterLabel = TRUE;
  2315. X                    break;
  2316. X                case 'c':
  2317. X                    if (isfloat(argv[arg+1]))
  2318. X                        Args.center = 
  2319. X                            atof(argv[++arg]);
  2320. X                    else
  2321. X                        usagexit(argv[0]);
  2322. X                    break;
  2323. X                case 'g':
  2324. X                    if ( arg+1 >= argc )
  2325. X                        usagexit(argv[0]);
  2326. X                    GridType = gridval(argv[++arg]);
  2327. X                    if (GridType == HALFOPEN) {
  2328. X                        GridType = OPEN;
  2329. X                        HalfGrid = TRUE;
  2330. X                    }
  2331. X                    if (GridType == HALFTICKS) {
  2332. X                        GridType = TICKS;
  2333. X                        HalfGrid = TRUE;
  2334. X                    }
  2335. X                    break;
  2336. X                case 'h':
  2337. X                    if ( isfloat(argv[arg+1]) )
  2338. X                        Height = atof(argv[++arg]);
  2339. X                    else
  2340. X                        usagexit(argv[0]);
  2341. X                    break;
  2342. X                case 'l':
  2343. X                    Title.title = newstr(argv[++arg]);
  2344. X                    break;
  2345. X                case 'p':
  2346. X                    if (arg+1 >= argc)
  2347. X                        usagexit(argv[0]);
  2348. X                    Prolog = argv[++arg];
  2349. X                    break;
  2350. X                case 'P':
  2351. X                    Preview = TRUE;
  2352. X                    break;
  2353. X                case 'r':
  2354. X                    if ( isfloat(argv[arg+1]) )
  2355. X                        Xoffset = atof(argv[++arg]);
  2356. X                    else
  2357. X                        usagexit(argv[0]);
  2358. X                    break;
  2359. X                case 't':
  2360. X                    TransposeAxes = TRUE;
  2361. X                    break;
  2362. X                case 'u':
  2363. X                    if ( isfloat(argv[arg+1]) )
  2364. X                        Yoffset = atof(argv[++arg]);
  2365. X                    else
  2366. X                        usagexit(argv[0]);
  2367. X                    break;
  2368. X                case 'w':
  2369. X                    if ( isfloat(argv[arg+1]) )
  2370. X                        Width = atof(argv[++arg]);
  2371. X                    else
  2372. X                        usagexit(argv[0]);
  2373. X                    break;
  2374. X                case 'x':
  2375. X                    arg = limargs(&Xlim,argc,argv,arg+1)-1;
  2376. X                    break;
  2377. X                case 'y':
  2378. X                    arg = limargs(&Ylim,argc,argv,arg+1)-1;
  2379. X                    break;
  2380. X                default:
  2381. X                    usagexit(argv[0]);
  2382. X                }
  2383. X            }
  2384. X        } else { /* there's no dash in front */
  2385. X            File[Files++] = argv[arg];
  2386. X        }
  2387. X    }
  2388. X}
  2389. Xusagexit(pgm)
  2390. Xchar *pgm;
  2391. X{
  2392. X    fprintf(stderr,"usage: %s \n",pgm);
  2393. X    exit(1);
  2394. X}
  2395. X
  2396. X/*
  2397. X * numpnts - returns the number of actual data points
  2398. X */
  2399. X
  2400. Xnumpnts()
  2401. X{
  2402. X    int i, cnt;
  2403. X    cnt = 0;
  2404. X    for ( i=0 ; i<NumTokens ; i++ )
  2405. X        if ( Token[i].type == POINT )
  2406. X            cnt++;
  2407. X    return cnt;
  2408. X}
  2409. X
  2410. Xtranspose()
  2411. X{
  2412. X    register int    i;
  2413. X    float        f;
  2414. X    axis_t        t;
  2415. X
  2416. X    if(!TransposeAxes)
  2417. X        return;
  2418. X    t = Xaxis; 
  2419. X    Xaxis = Yaxis; 
  2420. X    Yaxis = t;
  2421. X    for(i= 0; i < NumTokens; i++) {
  2422. X        if ( Token[i].type != POINT ) continue;
  2423. X        f = Token[i].xval; 
  2424. X        Token[i].xval = Token[i].yval; 
  2425. X        Token[i].yval = f;
  2426. X    }
  2427. X}
  2428. X
  2429. Xchar *newstr(s)
  2430. Xchar *s;
  2431. X{
  2432. X    char *t;
  2433. X    t = (char *)malloc((unsigned)(strlen(s)+1));
  2434. X    strcpy(t,s);
  2435. X    return t;
  2436. X}
  2437. X
  2438. X/*
  2439. X * isfloat - returns TRUE if the argument is a floating point number
  2440. X */
  2441. X
  2442. Xisfloat(cp)
  2443. Xchar *cp;
  2444. X{
  2445. X    while ( *cp && isspace(*cp) )
  2446. X        cp++;
  2447. X    if ( *cp == '-' )
  2448. X        cp++;
  2449. X    if ( isdigit(*cp) || *cp=='.' )
  2450. X        return TRUE;
  2451. X    return FALSE;
  2452. X}
  2453. X
  2454. X/*
  2455. X * dolimits - compute the minimum and maximum of the data points.
  2456. X *          compute the minimum and maximum to plot on the grid.
  2457. X */
  2458. X
  2459. Xdolimits(v)
  2460. X{
  2461. X
  2462. X    if (AxisArgs[v].tform == IDENT)
  2463. X        doLinearLimits(v);
  2464. X    else
  2465. X        doLogLimits(v);
  2466. X}
  2467. X
  2468. XdoLinearLimits(v)
  2469. Xregister int    v;
  2470. X{
  2471. X    register axis_t *argp;
  2472. X    register int i;
  2473. X    float min, max;
  2474. X
  2475. X    argp = &AxisArgs[v];
  2476. X    argp->min = HUGE;
  2477. X    for ( i=0; i<NumTokens ; i++ )
  2478. X        if ( Token[i].type == POINT )
  2479. X        argp->min = MIN(argp->min, Token[i].val[v]);
  2480. X
  2481. X    argp->max = -HUGE;
  2482. X    for ( i=0; i<NumTokens ; i++ )
  2483. X        if ( Token[i].type == POINT )
  2484. X        argp->max = MAX(argp->max, Token[i].val[v]);
  2485. X
  2486. X    if (argp->minflag)
  2487. X        min = argp->gmin;
  2488. X    else
  2489. X        min = argp->min;
  2490. X    if (argp->maxflag)
  2491. X        max = argp->gmax;
  2492. X    else
  2493. X        max = argp->max;
  2494. X
  2495. X    scale1(min, max, 5,
  2496. X        &argp->pmin, &argp->pmax, &argp->distp);
  2497. X    if ( !argp->minflag )
  2498. X        argp->gmin = argp->pmin;
  2499. X    if ( !argp->maxflag )
  2500. X        argp->gmax = argp->pmax;
  2501. X    if ( argp->distf )
  2502. X        argp->distg = argp->dist;
  2503. X    else
  2504. X        argp->distg = argp->distp;
  2505. X
  2506. X    /* avoid infinite loops */
  2507. X    if (argp->gmax == argp->gmin) {
  2508. X        if (argp->gmin > 0.0)
  2509. X        argp->gmin = 0.0;
  2510. X        else
  2511. X        argp->gmax += 1.0;
  2512. X    }
  2513. X}
  2514. X
  2515. XdoLogLimits(v)
  2516. Xregister int    v;
  2517. X{
  2518. X    register axis_t *argp;
  2519. X    register int i;
  2520. X
  2521. X    argp = &AxisArgs[v];
  2522. X
  2523. X    argp->min = HUGE;
  2524. X    for ( i=0; i<NumTokens ; i++ )
  2525. X        if ( Token[i].type == POINT ) {
  2526. X        if (Token[i].val[v] <= 0.0) {
  2527. X            fprintf(stderr, 
  2528. X                "Bad log point (%g, %g)\n", 
  2529. X                Token[i].val[0], 
  2530. X                Token[i].val[1]);
  2531. X            Token[i].type = IGNORE;
  2532. X            continue;
  2533. X        }
  2534. X        argp->min = MIN(argp->min, Token[i].val[v]);
  2535. X        }
  2536. X    if (argp->min <= 0.0) {
  2537. X        fprintf(stderr, "Illegal log minimum %g\n", argp->min);
  2538. X        exit(-1);
  2539. X    }
  2540. X    argp->max = -HUGE;
  2541. X    for ( i=0; i<NumTokens ; i++ )
  2542. X        if ( Token[i].type == POINT )
  2543. X        argp->max = MAX(argp->max, Token[i].val[v]);
  2544. X
  2545. X    argp->pmin = ipow(10.0, (int)floor(log10(argp->min)));
  2546. X    argp->pmax = ipow(10.0, (int)floor(log10(argp->max)) + 1);
  2547. X    argp->distp = copysign(2.0, (argp->gmax - argp->gmin)) ;
  2548. X    
  2549. X/*    scale3(argp->min, argp->max, argp->intervals,
  2550. X        &argp->pmin, &argp->pmax, &argp->distp);
  2551. X*/
  2552. X    if ( !argp->minflag )
  2553. X        argp->gmin = argp->pmin;
  2554. X    if ( !argp->maxflag )
  2555. X        argp->gmax = argp->pmax;
  2556. X    if ( argp->distf )
  2557. X        argp->distg = argp->dist;
  2558. X    else
  2559. X        argp->distg = argp->distp;
  2560. X    argp->lgmin = log10(argp->gmin);
  2561. X    argp->lgmax = log10(argp->gmax);
  2562. X}
  2563. X
  2564. X/*
  2565. X *----------------------------------------------------------------------
  2566. X *
  2567. X * TEXT PARSING ROUTINES
  2568. X *
  2569. X * parse - break a string into substrings
  2570. X */
  2571. X
  2572. Xparse(line, argc, argv)
  2573. Xchar *line;
  2574. Xint *argc;
  2575. Xchar *argv[];
  2576. X{
  2577. X    char *ptr, *nextarg();
  2578. X
  2579. X    ptr = line;
  2580. X    *argc = 0;
  2581. X    while ((ptr=nextarg(ptr,&argv[*argc])) != NULL )
  2582. X        (*argc)++;
  2583. X    argv[*argc] = NULL;
  2584. X}
  2585. Xchar *
  2586. Xnextarg(line, start)
  2587. Xregister char *line, **start;
  2588. X{
  2589. X    bool esc;
  2590. X    register char *out;
  2591. X    char delim;
  2592. X    while ( isspace(*line) && *line != EOS )
  2593. X        line++;
  2594. X    if ( *line == EOS )
  2595. X        return NULL;
  2596. X    *start = line;
  2597. X    if ( *line=='\'' || *line=='"' ) {
  2598. X        delim = *line;
  2599. X        out = ++line;
  2600. X        (*start)++;
  2601. X        esc = FALSE;
  2602. X        while(TRUE) {
  2603. X            if ( *line == '\\' ) {
  2604. X                if ( esc ) {
  2605. X                    out--;
  2606. X                    esc = FALSE;
  2607. X                } else
  2608. X                    esc = TRUE;
  2609. X            } else if ( *line == delim ) {
  2610. X                if ( esc ) {
  2611. X                    out--;
  2612. X                    esc = FALSE;
  2613. X                } else
  2614. X                    break;
  2615. X            } else if ( *line == EOS ) {
  2616. X                line--;
  2617. X                break;
  2618. X            } else
  2619. X                esc = FALSE;
  2620. X            *out++ = *line++;
  2621. X        }
  2622. X        *out = EOS;
  2623. X        return (++line);
  2624. X    } else {
  2625. X        while ( !isspace(*line) && *line != EOS )
  2626. X            line++;
  2627. X        if ( *line != EOS )
  2628. X            *line++ = EOS;
  2629. X        return line;
  2630. X    }
  2631. X}
  2632. END_OF_FILE
  2633. if test 15465 -ne `wc -c <'main.c'`; then
  2634.     echo shar: \"'main.c'\" unpacked with wrong size!
  2635. fi
  2636. # end of 'main.c'
  2637. fi
  2638. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  2639.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  2640. else
  2641. echo shar: Extracting \"'patchlevel.h'\" \(256 characters\)
  2642. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  2643. X/*
  2644. X**  This file records official patches.  RCS records the edit log.
  2645. X**
  2646. X**  $Header: patchlevel.h,v 1.1 92/08/04 14:03:24 mogul Exp $
  2647. X**
  2648. X**  $Log:    patchlevel.h,v $
  2649. X * Revision 1.1  92/08/04  14:03:24  mogul
  2650. X * Initial revision
  2651. X * 
  2652. X*/
  2653. X#define PATCHLEVEL 0
  2654. END_OF_FILE
  2655. if test 256 -ne `wc -c <'patchlevel.h'`; then
  2656.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  2657. fi
  2658. # end of 'patchlevel.h'
  2659. fi
  2660. if test -f 'psgraph.h' -a "${1}" != "-c" ; then 
  2661.   echo shar: Will not clobber existing file \"'psgraph.h'\"
  2662. else
  2663. echo shar: Extracting \"'psgraph.h'\" \(8416 characters\)
  2664. sed "s/^X//" >'psgraph.h' <<'END_OF_FILE'
  2665. X/* $Header: psgraph.h,v 1.8 92/08/04 17:55:13 mogul Exp $ */
  2666. X
  2667. X/*
  2668. X *               Copyright 1989, 1992 Digital Equipment Corporation
  2669. X *                          All Rights Reserved
  2670. X * 
  2671. X * 
  2672. X * Permission to use, copy, and modify this software and its documentation
  2673. X * is hereby granted only under the following terms and conditions.  Both
  2674. X * the above copyright notice and this permission notice must appear in
  2675. X * all copies of the software, derivative works or modified versions, and
  2676. X * any portions threof, and both notices must appear in supporting
  2677. X * documentation.
  2678. X * 
  2679. X * Users of this software agree to the terms and conditions set forth
  2680. X * herein, and hereby grant back to Digital a non-exclusive, unrestricted,
  2681. X * royalty-free right and license under any changes, enhancements or
  2682. X * extensions made to the core functions of the software, including but
  2683. X * not limited to those affording compatibility with other hardware or
  2684. X * software environments, but excluding applications which incorporate
  2685. X * this software.  Users further agree to use their best efforts to return
  2686. X * to Digital any such changes, enhancements or extensions that they make
  2687. X * and inform Digital of noteworthy uses of this software.  Correspondence
  2688. X * should be provided to Digital at:
  2689. X * 
  2690. X *                       Director of Licensing
  2691. X *                       Western Research Laboratory
  2692. X *                       Digital Equipment Corporation
  2693. X *                       250 University Avenue
  2694. X *                       Palo Alto, California  94301  
  2695. X * 
  2696. X * This software may be distributed (but not offered for sale or
  2697. X * transferred for compensation) to third parties, provided such third
  2698. X * parties agree to abide by the terms and conditions of this notice.
  2699. X * 
  2700. X * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS
  2701. X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  2702. X * WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL
  2703. X * EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  2704. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  2705. X * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  2706. X * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  2707. X * PERFORMANCE OF THIS SOFTWARE.
  2708. X */
  2709. X
  2710. X/* 
  2711. X * psgraph.h - Definitions for psgraph
  2712. X * 
  2713. X * Author:    Christopher A. Kent
  2714. X *         Western Research Laboratory
  2715. X *         Digital Equipment Corporation
  2716. X * Date:    Wed Jan  4 1989
  2717. X */
  2718. X
  2719. X/*
  2720. X * $Log:    psgraph.h,v $
  2721. X * Revision 1.8  92/08/04  17:55:13  mogul
  2722. X * undo RCS botch
  2723. X * 
  2724. X * Revision 1.7  1992/07/08  16:43:46  mogul
  2725. X * Stupid Ul tricks.
  2726. X * (math.h doesn't declare copysign() as returning double)
  2727. X *
  2728. X * Revision 1.6  92/07/08  15:50:32  mogul
  2729. X * PROLOG can now be defined in Makefile.
  2730. X * 
  2731. X * Revision 1.5  1992/04/02  00:45:01  kent
  2732. X * Changes to handle lots of points; when using dataticks, the axis
  2733. X * routines could get too big and overflow the operand stack. As
  2734. X * a result, the output PostScript code is even uglier.
  2735. X *
  2736. X * Revision 1.4  1992/04/01  23:28:24  kent
  2737. X *  Added datalabel verb, fixed a bug in handling blank input lines.
  2738. X *
  2739. X * Revision 1.3  1992/03/31  00:07:39  kent
  2740. X * Added markerscale verb.
  2741. X *
  2742. X * Revision 1.2  1992/03/30  23:54:25  kent
  2743. X * Added halfopen, halfticks grid styles, range frames, and gray.
  2744. X *
  2745. X * Revision 1.1  1992/03/20  21:29:05  kent
  2746. X * Initial revision
  2747. X *
  2748. X * Revision 1.10  92/02/21  17:13:23  mogul
  2749. X * Added Digital license info
  2750. X * 
  2751. X * Revision 1.9  91/02/04  16:48:11  mogul
  2752. X * Fixed text, marker colors
  2753. X * 
  2754. X * Revision 1.8  90/12/11  20:42:27  reid
  2755. X * Added new enum type members for LINEWIDTH and LINECOLOR
  2756. X * 
  2757. X * Revision 1.7  89/01/27  15:59:38  kent
  2758. X * Need to get the prolog from the standard place!
  2759. X * 
  2760. X * Revision 1.6  89/01/10  18:20:01  kent
  2761. X * Moved marker code to prolog, added error checking and messages.
  2762. X * 
  2763. X * Revision 1.5  89/01/09  22:18:49  kent
  2764. X * Added log scales.
  2765. X * 
  2766. X * Revision 1.4  89/01/04  18:12:35  kent
  2767. X * Added -p flag to specify alternate prologue file.
  2768. X * 
  2769. X * Revision 1.3  89/01/04  17:29:47  kent
  2770. X * Made command line arguments override compiled-in defaults for
  2771. X * all plots in a run, not just the first one. 
  2772. X * 
  2773. X * Revision 1.2  89/01/04  15:22:10  kent
  2774. X * Massive renaming. No functional change.
  2775. X * 
  2776. X * Revision 1.1  89/01/04  13:58:10  kent
  2777. X * Initial revision
  2778. X * 
  2779. X */
  2780. X
  2781. X#include <ctype.h>
  2782. X#include <math.h>
  2783. X
  2784. X#ifdef    ultrix
  2785. Xextern double copysign();    /* grrrr */
  2786. X#endif    ultrix
  2787. X
  2788. Xtypedef    char    bool;
  2789. X#define    TRUE    1
  2790. X#define    FALSE    0
  2791. X
  2792. X#define TOKENINC    16
  2793. X#define ARGC    16
  2794. X#define EOS    '\0'
  2795. X
  2796. X#ifndef    PROLOG
  2797. X#define    PROLOG    "/usr/local/lib/ps/psgraph.pro"
  2798. X#endif    PROLOG
  2799. X
  2800. X#define    TEXTFONT    "Times-Roman10"
  2801. X
  2802. X#define    MIN(a,b)    ((a)<(b)?(a):(b))
  2803. X#define    MAX(a,b)    ((a)>(b)?(a):(b))
  2804. X
  2805. Xtypedef enum {IDENT, LOG10}        tform_t;
  2806. Xtypedef enum {NONE,OPEN,TICKS,FULL,HALFOPEN,HALFTICKS}    grid_t;
  2807. Xtypedef    enum {NORTH, SOUTH, EAST, WEST}    dir_t;
  2808. X
  2809. Xtypedef struct _title {
  2810. X    char    *title;        /* title string    */
  2811. X    char    *font;        /* font for the title */
  2812. X} title_t;
  2813. X
  2814. Xtypedef struct _arg {        /* plot-specific parameters that can also be
  2815. X                 * specified on the command line */
  2816. X    bool    breakAfterLabel;/* automatic break after input label */
  2817. X    float    center;        /* center point of baseline */
  2818. X} arg_t;
  2819. X
  2820. Xtypedef struct _axis {        /* axis-specific parameters */
  2821. X    bool    minflag;    /* TRUE=>minimum specified explicitly    */
  2822. X    bool    maxflag;    /* TRUE=>maximum specified explicitly    */
  2823. X    bool    distf;        /* TRUE=>user-supplied grid spacing    */
  2824. X    bool    tickflag;    /* TRUE=>user supplied tick positions    */
  2825. X    bool    rangeframe;    /* TRUE=>axis only covers data range    */
  2826. X    bool    datatick;    /* TRUE=>ticks at real datapoints    */
  2827. X    bool    datalabel;    /* TRUE=>labels at real datapoints    */
  2828. X    float    tick;        /* user-supplied tick spacing        */
  2829. X    float    tickgray;    /* percent gray in which to draw ticks  */
  2830. X    grid_t    gridtype;    /* grid type in this dimension        */
  2831. X    bool    halfgrid;    /* don't draw a full frame for this axis*/
  2832. X    float    axisgray;    /* percent gray in which to draw axis   */
  2833. X    tform_t    tform;        /* transformation type            */
  2834. X    float    min, max;    /* data minimum and maximum        */
  2835. X    int    intervals;    /* number of intervals on axis        */
  2836. X    float    pmin, pmax;    /* computed plot minimum and maximum    */
  2837. X    float    distp;        /* computed distance between grid lines    */
  2838. X    float    gmin, gmax;    /* min and max to use on the grid    */
  2839. X        float    lgmin, lgmax;    /* log of gmin, gmax for log scales    */
  2840. X    float    distg;        /* grid spacing to actually use        */
  2841. X    float    dist;        /* grid line spacing            */
  2842. X    float    offset;        /* displacement                */
  2843. X    float    size;        /* grid size in inches            */
  2844. X    char    *label;        /* label to place on the axis        */
  2845. X    char    *font;        /* font to label axis in        */
  2846. X} axis_t;
  2847. X
  2848. Xtypedef struct _limit {        /* axis limit argument */
  2849. X    tform_t    tform;        /* transformation type            */
  2850. X    bool    minflag;    /* TRUE=>minimum specified explicitly    */
  2851. X    bool    maxflag;    /* TRUE=>maximum specified explicitly    */
  2852. X    bool    distf;        /* TRUE=>user-supplied grid spacing    */
  2853. X    float    min, max;    /* data minimum and maximum        */
  2854. X    float    dist;        /* grid line spacing            */
  2855. X} limit_t;
  2856. X
  2857. Xtypedef enum tokenType {    /* internalized graph tokens */
  2858. X    POINT, BREAK, LINETYPE, LINECOLOR, LINEWIDTH, MARKER, MARKERGRAY,
  2859. X    MARKERSCALE, FONT, TEXT, SPLINE, TRANS, IGNORE
  2860. X} type_t;
  2861. Xtypedef struct _token {
  2862. X    type_t    type;
  2863. X    float    val[2];
  2864. X    int    ival;
  2865. X    char    *label;
  2866. X}token_t;
  2867. X#define xval val[0]
  2868. X#define yval val[1]
  2869. X
  2870. Xtypedef struct _fontName {    /* the chain of fonts that were used */
  2871. X    char *name;
  2872. X    struct _fontName *next;
  2873. X}fontName_t;
  2874. X
  2875. Xarg_t    Args;            /* command-line arguments override defaults */
  2876. Xchar    *Prolog;
  2877. Xgrid_t    GridType;
  2878. Xbool    HalfGrid;
  2879. Xfloat    Height;
  2880. Xbool    Preview;
  2881. Xfloat    Xoffset;
  2882. Xfloat    Yoffset;
  2883. Xbool    TransposeAxes;
  2884. Xfloat    Width;
  2885. Xlimit_t    Xlim, Ylim;
  2886. X
  2887. Xbool    BreakAfterLabel;    /* plot-specific values */
  2888. Xfloat    ClipDist;
  2889. Xbool    DoAxisLabels;
  2890. Xint    PointSize;
  2891. Xchar    *TextFont;
  2892. Xfloat    TickLen;
  2893. Xfloat    Tick2Len;
  2894. Xbool    TransparentLabels;
  2895. Xfloat    Xcenter;
  2896. Xaxis_t    AxisArgs[2];
  2897. X
  2898. Xchar    **File;            /* global state */
  2899. Xint    Files;
  2900. Xint    CurrentPage;
  2901. Xfloat    MinX, MinY, MaxX, MaxY;
  2902. Xfloat    minX, minY, maxX, maxY;
  2903. Xchar    *LineType;
  2904. Xchar    *LineColor;
  2905. Xchar    *LineWidth;
  2906. Xbool    UseSpline;
  2907. Xtitle_t    Title;
  2908. Xtoken_t    *Token;
  2909. Xint    SizeofToken, NumTokens;
  2910. Xchar    *UseMarker;
  2911. XfontName_t    *FontList;
  2912. XfontName_t    *CurrentFont;
  2913. Xchar    *TextColor;
  2914. Xchar    *MarkColor;
  2915. Xint    CurrentTemp;
  2916. Xbool    TempOpen;
  2917. Xint    LinesInTemp;
  2918. X
  2919. X#define    Xaxis    AxisArgs[0]
  2920. X#define    Yaxis    AxisArgs[1]
  2921. X
  2922. Xchar    *newstr();
  2923. Xgrid_t    gridval();
  2924. Xfloat    sx(), sy(), SX(), SY();
  2925. Xfloat    plotx(), ploty();
  2926. Xfloat    ipow();
  2927. Xchar    *calloc(), *malloc(), *realloc();
  2928. Xdouble    atof();
  2929. X
  2930. END_OF_FILE
  2931. if test 8416 -ne `wc -c <'psgraph.h'`; then
  2932.     echo shar: \"'psgraph.h'\" unpacked with wrong size!
  2933. fi
  2934. # end of 'psgraph.h'
  2935. fi
  2936. if test -f 'psgraph.man' -a "${1}" != "-c" ; then 
  2937.   echo shar: Will not clobber existing file \"'psgraph.man'\"
  2938. else
  2939. echo shar: Extracting \"'psgraph.man'\" \(9533 characters\)
  2940. sed "s/^X//" >'psgraph.man' <<'END_OF_FILE'
  2941. X.TH PSGRAPH 1.1 "7 November 1990" DECWRL
  2942. X.SH NAME
  2943. Xpsgraph \- generate a graph in PostScript
  2944. X.SH SYNOPSIS
  2945. X.B psgraph
  2946. X[ option ] [ files ]...
  2947. X.SH DESCRIPTION
  2948. X.I Psgraph
  2949. Xoperates in a manner similar to
  2950. X.I graph(1),
  2951. Xin that it reads pairs of numbers from its standard input
  2952. Xand produces a graph.
  2953. XIf files are given as arguments, each file is processed to produce a separate 
  2954. Xgraph.
  2955. XThe output language is a complete 
  2956. X.I PostScript 
  2957. Xdocument, suitable for inclusion in a Scribe or TeX document, or, with the 
  2958. X.B \-P
  2959. Xflag, printing directly on a PostScript printer.
  2960. XSeveral differences exist between
  2961. X.I graph
  2962. Xand
  2963. X.IR psgraph ,
  2964. Xthe most significant of which is that
  2965. X.I psgraph
  2966. Xcan take all of its parameters
  2967. X(except 
  2968. X.BR \-P )
  2969. Xfrom its input instead of requiring that
  2970. Xeverything except data be on the command line.
  2971. X.SH OPTIONS
  2972. X.PP
  2973. XAll the options of
  2974. X.I graph
  2975. Xare supported, except
  2976. X.BR \-s .
  2977. XThe meaning of the
  2978. X.BR \-h ,
  2979. X.BR \-w ,
  2980. Xand
  2981. X.B \-c
  2982. Xoptions have changed.
  2983. XA few new options have been added as well.
  2984. X.TP
  2985. X.B  \-h
  2986. XNext argument is the height of the graph in inches.
  2987. X.TP
  2988. X.B  \-w
  2989. XSimilarly for width.
  2990. X.TP
  2991. X.B \-c
  2992. XCenter the X axis of the graph on the page width specified by the next argument
  2993. X(in inches). 
  2994. X.TP
  2995. X.B \-P
  2996. XProduce an output file with a 
  2997. X.B showpage
  2998. Xcommand at the end of each graph, and a 
  2999. X.B translate
  3000. Xcommand that assures that the entire graph will appear on the output page.
  3001. X.TP
  3002. X.B \-p
  3003. XUse the file named by the next argument as the PostScript prologue, instead of 
  3004. Xthe standard one. 
  3005. XThis allows you to define new line styles and marker shapes.
  3006. X.SH INPUT
  3007. X.PP
  3008. XInput is line oriented; lines beginning with a pound sign are ignored.
  3009. XEach line either specifies a data point (one or two numbers followed by an
  3010. Xoptional label) or a command.
  3011. XLines are parsed into fields separated by white space.
  3012. XA string of text enclosed in quotation marks or apostrophes is considered a
  3013. Xsingle field.
  3014. XCommand lines consist of a keyword followed by zero or more modifiers.
  3015. XSome commands affect the entire graph (such as one to specify the grid type)
  3016. Xand so can be placed anywhere in the input (though placing them at the top
  3017. Xis conventional).
  3018. XOther commands only affect the data that follows them (such as the one to
  3019. Xmodify the line or marker type).
  3020. X.PP
  3021. XData points in the input are interpreted as in
  3022. X.I graph(1).
  3023. XIf the 
  3024. X.B \-a
  3025. Xoption is specified, only one number is expected, otherwise two.
  3026. XIf a label (second or third field) is given, that label is printed on the
  3027. Xgraph at the location of the point given on the same line.
  3028. X.PP
  3029. XThe following commands are recognized:
  3030. X.sp
  3031. X.IP CMD 1i
  3032. XDESCRIPTION
  3033. X.IP break 1i
  3034. XBreak the plot at this point in the input.
  3035. X.IP "include F" 1i
  3036. XSwitch to reading input from the file
  3037. X.IR F .
  3038. XYes, recursive 
  3039. X.IR include s
  3040. Xare handled properly.
  3041. X.IP "line S" 1i
  3042. XConnect subsequent points with a line of type S,
  3043. Xwhere S is
  3044. X.IR solid ,
  3045. X.IR dotdashed ,
  3046. X.IR shortdashed ,
  3047. X.IR longdashed , 
  3048. X.IR dotted , 
  3049. Xor
  3050. X.IR off ,
  3051. Xwith or without quotes.  If S is omitted, splines are turned
  3052. Xoff (if on) and the line type remains unchanged.
  3053. X.IP "color C" 1i
  3054. XSet the color to be used in subsequent lines to be the one named "C",
  3055. Xwhere C is
  3056. X.IR red ,
  3057. X.IR blue ,
  3058. X.IR magenta ,
  3059. X.IR green ,
  3060. X.IR black ,
  3061. X.IR cyan ,
  3062. X.IR yellow ,
  3063. X.IR gray ,
  3064. X.IR orange ,
  3065. Xor
  3066. X.IR violet ,
  3067. Xwith or without quotes. If C is omitted, the color is set to black.
  3068. X.IP "linewidth D" 1i
  3069. XSets the width for subsequent graphed lines. The argument is a floating-point
  3070. Xnumber, and is the number of points of line width. There are 72 points to an
  3071. Xinch. The default line width is 0.6 points.
  3072. X.IP "transparent" 1i
  3073. XNormally, the label associated with a point is painted with a white background,
  3074. Xobliterating any text or graphics behind it. 
  3075. XThis command causes the text to be painted without first painting a white
  3076. Xbackground box.
  3077. X.IP "notransparent" 1i
  3078. XWhen painting a point label, first paint a white background box behind it.
  3079. X.IP "label" 1i
  3080. XPlace numeric labels on the end of each grid line.
  3081. X.IP "nolabel" 1i
  3082. XDo not place numeric labels on grid lines.
  3083. X.IP "tick N [M]" 1i
  3084. XMake grid tick marks (for
  3085. X.BR "grid tick" )
  3086. XN inches long.
  3087. XA second numeric parameter M states the length of secondary tick marks \-
  3088. Xthose generated by the 
  3089. X.B "x tick N"
  3090. Xcommand.
  3091. X.IP datatick 1i
  3092. XPlace ticks only where there is a data point.
  3093. X.IP datalabel 1i
  3094. XLabel every datatick.
  3095. X.ne 3
  3096. X.IP "grid N" 1i
  3097. XDraw grid type N, 0=no grid, 1=frame grid, 2=frame grid with tick marks,
  3098. X3=mesh grid, 4=frame grid with only left and bottom axes, 5=grid 4 with
  3099. Xtick marks.
  3100. XGets applied to both dimensions. Also, the more descriptive
  3101. X.IR none , 
  3102. X.IR open ,
  3103. X.IR tick ,
  3104. X.IR full ,
  3105. X.IR halfopen ,
  3106. Xor
  3107. X.I halftick
  3108. Xmay be used.
  3109. XFor historical reasons, grid type 3, 
  3110. X.IR full ,
  3111. Xis the default. 
  3112. X.ne 2
  3113. X.IP rangeframe 1i
  3114. XFor all grid types except
  3115. X.I none
  3116. Xand
  3117. X.IR full,
  3118. Xonly draw the axis line over the range of the data on that axis.
  3119. XTicks or scales, if any, are drawn on the entire axis.
  3120. X.IP "tickgray f"
  3121. XDraw the ticks in f percent gray; default is 100% (full black).
  3122. X.IP "axisgray f"
  3123. XDraw the ticks in f percent gray; default is 100% (full black).
  3124. X.ne 3
  3125. X.IP "clip N"
  3126. XData points and connecting lines are clipped to the grid, to some
  3127. Xtolerance. The default tolerance is 0.05; that is, if the data value lies
  3128. Xup to 5% outside the axis limits, it will be plotted. The 
  3129. X.B clip
  3130. Xverb is used to change the value of this tolerance. 
  3131. XLog scale users should be warned that the calculation is done in ``linear
  3132. Xspace'' and will often not behave as expected.
  3133. X.IP "font f"
  3134. XSwitch to font 
  3135. X.I f
  3136. Xfor subsequent marker label text. 
  3137. XFonts are named as for 
  3138. X.IR enscript(1) ,
  3139. Xe.g., ``Times-Roman10''.
  3140. X.IP "width N" 1i
  3141. XMake the grid N (float) inches wide.
  3142. XOverridden by the
  3143. X.B "size N"
  3144. Xcommand.
  3145. X.IP "height N" 1i
  3146. XMake the grid N (float) inches high.
  3147. XOverridden by the
  3148. X.B "size N"
  3149. Xcommand.
  3150. X.IP "center N" 1i
  3151. XCenter the X axis on an N (float) inch wide line.
  3152. X.IP "spline" 1i
  3153. XSubsequent data is plotted as splines.  Causes
  3154. Xa break.
  3155. XMarkers, if turned on, still appear at the actual data point.
  3156. X.IP "marker m" 1i
  3157. XPlot subsequent points with marker type 
  3158. X.IR m .
  3159. XIf 
  3160. X.I m
  3161. Xis 
  3162. X.IR none ,
  3163. X.IR off ,
  3164. Xor omitted, markers are turned off.
  3165. XOtherwise, valid values for 
  3166. X.I m
  3167. Xare
  3168. X.IR square , 
  3169. X.IR diamond , 
  3170. X.IR triangle , 
  3171. X.IR up , 
  3172. X.IR down , 
  3173. X.IR right ,
  3174. X.IR left , 
  3175. X.IR circle , 
  3176. X.IR x , 
  3177. X.IR plus ,
  3178. X.IR cross , 
  3179. X.IR circle-x , 
  3180. X.IR circle-plus ,
  3181. X.IR filledsquare ,
  3182. X.IR filleddiamond ,
  3183. X.IR filledtriangle ,
  3184. Xand 
  3185. X.IR filledcircle .
  3186. X.IP "markerscale s" 1i
  3187. XScale the markers (if they are turned on) by the floating point scale value
  3188. X.IR s .
  3189. XThe default value for s is 1.0.
  3190. X.IP "markergray f" 1i
  3191. XDraw the markers in f percent gray; default is 100% (full black). 
  3192. XAny subsequent \fBcolor\fR command overrides this setting, and this
  3193. Xoverrides only the marker color if a \fBcolor\fR command has been issued.
  3194. X.IP "title \fIfoo\fR" 1i
  3195. XUse 
  3196. X.I foo
  3197. Xas the title for this plot (displayed at the top).
  3198. X.IP "titlefont \fIbar\fR" 1i
  3199. XDisplay the title in font
  3200. X.IR bar .
  3201. XFonts are named as for
  3202. X.IR enscript(1) ,
  3203. Xe.g., ``Times-Roman10''.
  3204. X.IP "x args" 1i
  3205. XModify x data processing (see below)
  3206. X.IP "y args" 1i
  3207. XModify y data processing (see below)
  3208. X.LP
  3209. XThe arguments for the 
  3210. X.B x 
  3211. Xand 
  3212. X.B y 
  3213. Xcommands can all be placed on a
  3214. Xsingle line, or separate 
  3215. X.B x
  3216. Xand 
  3217. X.B y
  3218. Xlines can be used for each.
  3219. X.IP "log" 1i
  3220. XPlot this dimension on a logarithmic scale.
  3221. X.IP "min N" 1i
  3222. XMinimum on the grid is N (float)
  3223. X.IP "max N" 1i
  3224. XMaximum on the grid is N (float)
  3225. X.IP "step N" 1i
  3226. XDistance between grid lines and numeric labels is N (float). No effect for
  3227. Xlinear scales.
  3228. X.IP "tick N" 1i
  3229. XDistance between secondary ticks is N (float). No effect for log scales.
  3230. X.IP "intervals N" 1i
  3231. XNumber of intervals in a decade is N (integer). No effect for linear scales.
  3232. X.IP datatick 1i
  3233. XPlace ticks only where there is a data point.
  3234. X.IP datalabel 1i
  3235. XLabel every datatick.
  3236. X.IP "offset N" 1i
  3237. XDistance between border of page and minimum edge of the grid in this
  3238. Xdimension is N (float) inches.
  3239. X.ne 2
  3240. X.IP rangeframe 1i
  3241. XFor all grid types except
  3242. X.I none
  3243. Xand
  3244. X.IR full,
  3245. Xonly draw the axis line over the range of the data on that axis.
  3246. XTicks or labels, if any, are drawn on the entire axis.
  3247. X.IP "tickgray f"
  3248. XDraw the ticks in f percent gray; default is 100% (full black).
  3249. X.IP "axisgray f"
  3250. XDraw the ticks in f percent gray; default is 100% (full black).
  3251. X.IP "label \fIfoo\fR" 1i
  3252. XUse
  3253. X.I foo
  3254. Xas the label for this axis.
  3255. X.IP "size N" 1i
  3256. XMake the grid this big (N is in inches).
  3257. XOverrides the 
  3258. X.B width
  3259. Xand
  3260. X.B height
  3261. Xcommands.
  3262. X.IP "grid N" 1i
  3263. XSpecify the grid type in this dimension (as above).
  3264. X.IP "font \fIfoo\fR" 1i
  3265. XDraw the axis labels in font
  3266. X.IR foo .
  3267. XFonts are named as for 
  3268. X.IR enscript(1) ,
  3269. Xe.g., ``Times-Roman10''.
  3270. X.SH FILES
  3271. X/usr/local/lib/ps/psgraph.pro \- standard prologue
  3272. X.SH SUGGESTIONS
  3273. XMany of the options are provided to minimize 
  3274. X.BR chartjunk ,
  3275. Xthat is, to maximize the data to ink ratio. 
  3276. XTo this end, the grid types 
  3277. X.I halfopen
  3278. Xand
  3279. X.I halftick
  3280. Xare the most useful.
  3281. X.PP
  3282. X.I Rangeframe
  3283. Xand 
  3284. X.I datatick
  3285. Xwere designed to make a standard bivariate scatterplot more useful.
  3286. X.PP
  3287. XAll the graphical elements of the frame can be removed, either by careful
  3288. Xselection of the grid type, the various gray settings, or 
  3289. X.IR nolabel .
  3290. X.SH "SEE ALSO"
  3291. Xenscript(1), graph(1), psgsimp(1)
  3292. X.PP
  3293. XTufte, Edward, R. 
  3294. X.I "The Visual Display of Quantitative Information."
  3295. XGraphics Press, P.O. Box 430, Cheshire, CT. 1983.
  3296. X.PP
  3297. XTufte, Edward, R. 
  3298. X.I "Envisioning Information."
  3299. XGraphics Press, P.O. Box 430, Cheshire, CT. 1990.
  3300. X.SH BUGS
  3301. XA superset of the bugs listed in
  3302. X.I graph(1).
  3303. X.PP
  3304. XThere are almost certainly too many options.
  3305. END_OF_FILE
  3306. if test 9533 -ne `wc -c <'psgraph.man'`; then
  3307.     echo shar: \"'psgraph.man'\" unpacked with wrong size!
  3308. fi
  3309. # end of 'psgraph.man'
  3310. fi
  3311. if test -f 'psgraph.pro' -a "${1}" != "-c" ; then 
  3312.   echo shar: Will not clobber existing file \"'psgraph.pro'\"
  3313. else
  3314. echo shar: Extracting \"'psgraph.pro'\" \(4169 characters\)
  3315. sed "s/^X//" >'psgraph.pro' <<'END_OF_FILE'
  3316. X% psgraph.pro -- included prolog for PS graph files
  3317. X% based on lib/psplot.pro, Copyright 1984 Adobe Systems, Inc.
  3318. X% $Header: psgraph.pro,v 1.6 92/08/04 17:55:20 mogul Exp $
  3319. Xsave 500 dict begin /psgraph exch def
  3320. X/StartPSGraph
  3321. X   {newpath 0 0 moveto 0.6 setlinewidth 0 setgray 1 setlinecap
  3322. X    /imtx matrix currentmatrix def 
  3323. X    /fnt /Times-Roman findfont def /fontsize 10 def
  3324. X    72 72 scale
  3325. X    /ex 72 nail def /ey 720 nail def
  3326. X    /smtx matrix def fnt fontsize scalefont setfont}bind def
  3327. X/len{dup mul exch dup mul add sqrt}bind def
  3328. X/nail{0 dtransform len 0 idtransform len}bind def
  3329. X/ljust{0 fontsize -3 div rmoveto}bind def
  3330. X/rjust{dup stringwidth pop neg fontsize -3 div rmoveto}bind def
  3331. X/cjust{dup stringwidth pop -2 div fontsize -3 div rmoveto}bind def
  3332. X/vjust{90 rotate /cjust load exec}bind def
  3333. X/prnt{dup stringwidth pop 6 add /tx exch def /ty fontsize 5 add def
  3334. X    currentpoint /toy exch def /tox exch def 1 setgray
  3335. X    newpath
  3336. X      tox 3 sub toy 5 sub moveto 0 ty rlineto tx 0 rlineto 0 ty neg rlineto
  3337. X    closepath fill tox toy moveto
  3338. X    currentColor fc
  3339. X    show}bind def
  3340. X/m{newpath moveto}bind def
  3341. X/s{pts stroke ins}bind def
  3342. X/fl{pts fill ins}bind def
  3343. X/n{lineto currentpoint s moveto}bind def
  3344. X/nf{lineto}bind def
  3345. X/l{moveto lineto currentpoint s moveto}bind def
  3346. X/pts{smtx currentmatrix pop imtx setmatrix}bind def
  3347. X/ins{smtx setmatrix}bind def
  3348. X/t{pts load exec show ins}bind def
  3349. X/w{pts load exec prnt ins}bind def
  3350. X/e{pts ex ey moveto prnt prnt /ey ey 12 sub def ins}bind def
  3351. X/gs{gsave}bind def
  3352. X/gr{grestore}bind def
  3353. X/c{gs newpath 0 0 3 -1 roll 0 360 arc s gr}bind def
  3354. X/cf{gs newpath 0 0 3 -1 roll 0 360 arc fl gr}bind def
  3355. X/f{dup lineStyles exch known
  3356. X    {lineStyles begin load exec setdash end}
  3357. X    {gs C 20 string cvs (No such line style: ) e gr unC/solid f}ifelse}bind def
  3358. X/fc{dup dup /currentColor exch store lineColors exch known
  3359. X    {lineColors begin load exec aload pop setrgbcolor end}
  3360. X    {gs C 20 string cvs (No such psgraph color: ) e gr unC/black fc}ifelse}bind def
  3361. X/fw{setlinewidth} def
  3362. X/C{/Courier findfont 10 scalefont setfont 
  3363. X    /sfs fontsize def /fontsize 10 def}bind def
  3364. X/unC{/fontsize sfs def}bind def
  3365. X/EX{/exec load}bind def
  3366. X/EndPSGraph{clear psgraph end restore}bind def
  3367. X/lineStyles 10 dict def lineStyles begin
  3368. X/solid{{}0}bind def
  3369. X/dotted{[2 nail 5 nail ] 0}bind def
  3370. X/longdashed{[10 nail] 0}bind def
  3371. X/shortdashed{[6 nail] 0}bind def
  3372. X/dotdashed{[2 nail 6 nail 10 nail 6 nail] 0}bind def
  3373. X/dashed{/shortdashed load exec}bind def
  3374. X%/off{[0 100] 0}bind def
  3375. X%/none{/off load exec}bind def
  3376. Xend
  3377. X/currentColor 0 def
  3378. X/lineColors 10 dict def lineColors begin
  3379. X/red {[1 0 0]}bind def
  3380. X/blue {[0 0 1]}bind def
  3381. X/magenta {[1 0 1]}bind def
  3382. X/green {[0 1 0]}bind def
  3383. X/black {[0 0 0]}bind def
  3384. X/cyan {[0 1 1]}bind def
  3385. X/yellow {[1 1 0]}bind def
  3386. X/gray {[.5 .5 .5]}bind def
  3387. X/orange {[1 .66 0]}bind def
  3388. X/violet {[1 0 1]}bind def
  3389. X/currentColor /black store
  3390. Xend
  3391. X
  3392. X/markers 20 dict def markers begin
  3393. X/none{}bind def
  3394. X/off{}bind def
  3395. X/square{0 0 m 0 1 n 1 1 n 1 -1 n -1 -1 n -1 1 n 0 1 n s}bind def
  3396. X/diamond{0 0 m 0 1.41 n 1.41 0 n 0 -1.41 n -1.41 0 n 0 1.41 n s}bind def
  3397. X/triangle{0 0 m 0 1 n 1 -0.73 n -1 -0.73 n 0 1 n s}bind def
  3398. X/up{triangle}bind def
  3399. X/down{0 0 m 0 -1 n 1 0.73 n -1 0.73 n 0 -1 n s}bind def
  3400. X/right{0 0 m 1 0 n -0.73 1 n -0.73 -1 n 1 0 n s}bind def
  3401. X/left{0 0 m -1 0 n 0.73 1 n 0.73 -1 n -1 0 n s}bind def
  3402. X/circle{0 1 m 0 0 n 1 c s}bind def
  3403. X/x{1 1 m -1 -1 n -1 1 m 1 -1 n s}bind def
  3404. X/plus{0 1 m 0 -1 n -1 0 m 1 0 n s}bind def
  3405. X/cross{plus}bind def
  3406. X/circle-x{1 c .707 .707 m -.707 -.707 n -.707 .707 m .707 -.707 n s}bind def
  3407. X/circle-plus{1 c 0 1 m 0 -1 n -1 0 m 1 0 n s}bind def
  3408. X/filledsquare{0 1 m 1 1 nf 1 -1 nf -1 -1 nf -1 1 nf 0 1 nf fl}bind def
  3409. X/filleddiamond{0 1.41 m 1.41 0 nf 0 -1.41 nf -1.41 0 nf 0 1.41 nf fl}bind def
  3410. X/filledtriangle{0 1 m 1 -0.73 nf -1 -0.73 nf 0 1 nf fl}bind def
  3411. X/filledcircle{0 0 m 1 cf}bind def
  3412. X/marker{}def
  3413. Xend
  3414. X/ms 1.0 def
  3415. X/mg 0 def
  3416. X/sm{dup markers exch known
  3417. X    {markers begin load /marker exch def end}
  3418. X    {gs C 20 string cvs (No such marker type: )e gr unC/off sm}ifelse}bind def
  3419. X/mk{gs translate /solid f
  3420. X    mg 0.0 ne {mg setgray} if
  3421. X    ms .04 mul dup scale markers begin marker end gr}bind def
  3422. X% end fixed prolog
  3423. END_OF_FILE
  3424. if test 4169 -ne `wc -c <'psgraph.pro'`; then
  3425.     echo shar: \"'psgraph.pro'\" unpacked with wrong size!
  3426. fi
  3427. # end of 'psgraph.pro'
  3428. fi
  3429. if test -f 'psgsimp.c' -a "${1}" != "-c" ; then 
  3430.   echo shar: Will not clobber existing file \"'psgsimp.c'\"
  3431. else
  3432. echo shar: Extracting \"'psgsimp.c'\" \(4333 characters\)
  3433. sed "s/^X//" >'psgsimp.c' <<'END_OF_FILE'
  3434. X/*
  3435. X * psgsimp.c
  3436. X *
  3437. X * Simplify a psgraph-style plot file, removing graph points closer
  3438. X * together than a specified threshold.
  3439. X *
  3440. X * Jeffrey Mogul    DECWRL        10 January 1992
  3441. X * 
  3442. X *               Copyright (c) 1992 Digital Equipment Corporation
  3443. X *                          All Rights Reserved
  3444. X * 
  3445. X * 
  3446. X * Permission to use, copy, and modify this software and its documentation
  3447. X * is hereby granted only under the following terms and conditions.  Both
  3448. X * the above copyright notice and this permission notice must appear in
  3449. X * all copies of the software, derivative works or modified versions, and
  3450. X * any portions threof, and both notices must appear in supporting
  3451. X * documentation.
  3452. X * 
  3453. X * Users of this software agree to the terms and conditions set forth
  3454. X * herein, and hereby grant back to Digital a non-exclusive, unrestricted,
  3455. X * royalty-free right and license under any changes, enhancements or
  3456. X * extensions made to the core functions of the software, including but
  3457. X * not limited to those affording compatibility with other hardware or
  3458. X * software environments, but excluding applications which incorporate
  3459. X * this software.  Users further agree to use their best efforts to return
  3460. X * to Digital any such changes, enhancements or extensions that they make
  3461. X * and inform Digital of noteworthy uses of this software.  Correspondence
  3462. X * should be provided to Digital at:
  3463. X * 
  3464. X *                       Director of Licensing
  3465. X *                       Western Research Laboratory
  3466. X *                       Digital Equipment Corporation
  3467. X *                       250 University Avenue
  3468. X *                       Palo Alto, California  94301  
  3469. X * 
  3470. X * This software may be distributed (but not offered for sale or
  3471. X * transferred for compensation) to third parties, provided such third
  3472. X * parties agree to abide by the terms and conditions of this notice.
  3473. X * 
  3474. X * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS
  3475. X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  3476. X * WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL
  3477. X * EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  3478. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  3479. X * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  3480. X * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  3481. X * PERFORMANCE OF THIS SOFTWARE.
  3482. X */
  3483. X
  3484. X#include <stdio.h>
  3485. X#include <math.h>
  3486. X
  3487. X#ifndef    HUGE_VAL
  3488. X#define    HUGE_VAL    HUGE
  3489. X#endif
  3490. X
  3491. XUsage()
  3492. X{
  3493. X    fprintf(stderr, "Usage: psgsimp thresh-pct <infile >outfile\n");
  3494. X}
  3495. X
  3496. Xmain(argc, argv)
  3497. Xint argc;
  3498. Xchar **argv;
  3499. X{
  3500. X    double thresh;
  3501. X    static char linebuf[1024];
  3502. X    static char lasthidden[1024];
  3503. X    float lastx, lasty;
  3504. X    float thisx, thisy;    /* sscanf() deals in floats, not doubles */
  3505. X    float deltax, deltay;
  3506. X    static char otherstuff[1024];
  3507. X
  3508. X    if (argc != 2) {
  3509. X        Usage();
  3510. X        exit(1);
  3511. X    }
  3512. X    
  3513. X    thresh = atof(argv[1]);
  3514. X    
  3515. X    lastx = HUGE_VAL;
  3516. X    lasty = HUGE_VAL;
  3517. X
  3518. X    lasthidden[0] = '\0';
  3519. X
  3520. X    while (gets(linebuf)) {
  3521. X        if (sscanf(linebuf, "%f %f %s", &thisx, &thisy, otherstuff) == 2) {
  3522. X        /* only x, y value on this line */
  3523. X
  3524. X        /* compute deltax ratio */
  3525. X        if ((thisx == 0.0) && (lastx == 0.0)) {
  3526. X            deltax = 0.0;
  3527. X        }
  3528. X        else if (thisx == 0.0) {
  3529. X            deltax = (thisx - lastx)/lastx;
  3530. X        }
  3531. X        else {
  3532. X            deltax = (thisx - lastx)/thisx;
  3533. X        }
  3534. X        if (deltax < 0.0)
  3535. X            deltax = -deltax;
  3536. X        
  3537. X        /* compute deltay ratio */
  3538. X        if ((thisy == 0.0) && (lasty == 0.0)) {
  3539. X            deltay = 0.0;
  3540. X        }
  3541. X        else if (thisy == 0.0) {
  3542. X            deltay = (thisy - lasty)/lasty;
  3543. X        }
  3544. X        else {
  3545. X            deltay = (thisy - lasty)/thisy;
  3546. X        }
  3547. X        if (deltay < 0.0)
  3548. X            deltay = -deltay;
  3549. X        
  3550. X#ifdef    DEBUG
  3551. X        printf("# x %f -> %f (%f), y %f -> %f (%f)\n",
  3552. X            lastx, thisx, deltax,
  3553. X            lasty, thisy, deltay);
  3554. X#endif    DEBUG
  3555. X        
  3556. X        if ((deltax < thresh) && (deltay < thresh)) {
  3557. X            printf("##%s\n", linebuf);
  3558. X            strcpy(lasthidden, linebuf);
  3559. X            continue;
  3560. X        }
  3561. X
  3562. X        lastx = thisx;
  3563. X        lasty = thisy;
  3564. X        if (lasthidden[0] != '\0') {
  3565. X            printf("%s\n", lasthidden);
  3566. X        }
  3567. X        printf("%s\n", linebuf);
  3568. X        lasthidden[0] = '\0';
  3569. X        }
  3570. X        else {
  3571. X        if (lasthidden[0] != '\0') {
  3572. X            printf("%s\n", lasthidden);
  3573. X        }
  3574. X        printf("%s\n", linebuf);
  3575. X        lasthidden[0] = '\0';
  3576. X        if (linebuf[0] != '#') {
  3577. X            /* if non-comment, ensure next point is not suppressed */
  3578. X            lastx = HUGE_VAL;
  3579. X            lasty = HUGE_VAL;
  3580. X        }
  3581. X        }
  3582. X    }
  3583. X}
  3584. END_OF_FILE
  3585. if test 4333 -ne `wc -c <'psgsimp.c'`; then
  3586.     echo shar: \"'psgsimp.c'\" unpacked with wrong size!
  3587. fi
  3588. # end of 'psgsimp.c'
  3589. fi
  3590. if test -f 'psgsimp.man' -a "${1}" != "-c" ; then 
  3591.   echo shar: Will not clobber existing file \"'psgsimp.man'\"
  3592. else
  3593. echo shar: Extracting \"'psgsimp.man'\" \(2347 characters\)
  3594. sed "s/^X//" >'psgsimp.man' <<'END_OF_FILE'
  3595. X.TH PSGSIMP 1.0 "12 March 1992" DECWRL
  3596. X.SH NAME
  3597. Xpsgsimp \- simplify an input file for psgraph
  3598. X.SH SYNOPSIS
  3599. X.B psgsimp 
  3600. X.I threshold-pcnt
  3601. X.SH DESCRIPTION
  3602. X.I Psgsimp
  3603. Xis a filter that reads a
  3604. X.I psgraph
  3605. Xinput file from the standard input, and writes a simplified version
  3606. Xof the file to the standard output.  The program takes exactly one
  3607. Xargument,
  3608. X.IR threshold-pcnt ,
  3609. Xwhich specifies the amount of simplification.
  3610. X.PP
  3611. XThe intent of
  3612. X.I psgsimp
  3613. Xis to remove excessive detail from an automatically-generated
  3614. Xinput file before plotting it with
  3615. X.IR psgraph .
  3616. XThis can significantly reduce the amount of time it takes to print
  3617. Xthe resulting PostScript file, without much affecting the final output.
  3618. X.PP
  3619. XThe meaning of
  3620. X.I threshold-pct
  3621. Xis that
  3622. X.I psgsimp
  3623. Xshould suppress
  3624. Xany point which differs from its predecessor by less than
  3625. Xthis value in both the X and Y directions.  For example, if
  3626. X.I threshold-pct
  3627. Xis 1.0, then any change of less than one per cent is suppressed.
  3628. XLables, markers, and the end points of lines are always plotted; only the
  3629. Xintermediate points are ever suppressed.
  3630. X.PP
  3631. XThe time reduction can be quite dramatic; for example, one graph that
  3632. Xcontains 37,000 points took over 16 minutes to plot on an LPS-20.
  3633. XUsing a simplification threshold of 1.0, which eliminates details too
  3634. Xsmall to be seen on the final plot,
  3635. X.I psgsimp
  3636. Xreduced the size of the input file to about 6,000 points.  The resulting
  3637. XPostScript file took about two minutes to print, and was indistinguishable
  3638. Xfrom the unsimplified version.
  3639. X.PP
  3640. XNote that you may have to experiment somewhat with different
  3641. Xvalues for
  3642. X.IR threshold-pct ,
  3643. Xsince some graphs will suffer more from simplification than others.
  3644. X.PP
  3645. XThe output file contains all the removed input points as comments;
  3646. Xthis allows you to add back any points you want if you think the result
  3647. Xwill look better.  To remove these comments (and perhaps reclaim some 
  3648. Xdisk space) use ``grep -v "##"''.
  3649. X.SH EXAMPLES
  3650. XYou can use the program in a pipeline, e.g.:
  3651. X.nf
  3652. X.RS
  3653. Xgraph-generator | psgsimp 1.0 | psgraph -P | lpr \-h
  3654. X.RE
  3655. X.fi
  3656. Xor you can use it to generate an intermediate file, without comments:
  3657. X.nf
  3658. X.RS
  3659. Xgraph-generator >figure-1.plot
  3660. Xpsgsimp 1.0 <figure-1.plot | grep -v "##" >figure-1.simp
  3661. Xpsgraph -P figure-1.simp >figure-1.psf
  3662. Xlpr \-h figure-1.psf
  3663. X.RE
  3664. X.fi
  3665. X.SH "SEE ALSO"
  3666. Xpsgraph(1)
  3667. X.SH AUTHOR
  3668. XJeffrey Mogul, DECWRL
  3669. X
  3670. X
  3671. END_OF_FILE
  3672. if test 2347 -ne `wc -c <'psgsimp.man'`; then
  3673.     echo shar: \"'psgsimp.man'\" unpacked with wrong size!
  3674. fi
  3675. # end of 'psgsimp.man'
  3676. fi
  3677. echo shar: End of archive 1 \(of 3\).
  3678. cp /dev/null ark1isdone
  3679. MISSING=""
  3680. for I in 1 2 3 ; do
  3681.     if test ! -f ark${I}isdone ; then
  3682.     MISSING="${MISSING} ${I}"
  3683.     fi
  3684. done
  3685. if test "${MISSING}" = "" ; then
  3686.     echo You have unpacked all 3 archives.
  3687.     rm -f ark[1-9]isdone
  3688. else
  3689.     echo You still need to unpack the following archives:
  3690.     echo "        " ${MISSING}
  3691. fi
  3692. ##  End of shell archive.
  3693. exit 0
  3694.