home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / psgraph / part01 < prev    next >
Encoding:
Text File  |  1992-09-06  |  90.0 KB  |  3,688 lines

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