home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume11 / gnuplot2 / part01 < prev    next >
Encoding:
Text File  |  1990-03-25  |  68.7 KB  |  2,248 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Pixar -- Marin County, California
  3. subject: v11i066: Gnuplot 2.0 - 1 of 14
  4. From: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 11, Issue 66
  8. Submitted-by: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
  9. Archive-name: gnuplot2/part01
  10.  
  11. This is gnuplot.sh01
  12.  
  13. --- CUT HERE ---
  14. #! /bin/sh
  15. echo x - Copyright
  16. sed 's/^X//' >Copyright <<'*-*-END-of-Copyright-*-*'
  17. X/*
  18. X * Copyright (C) 1986, 1987, 1990   Thomas Williams, Colin Kelley
  19. X *
  20. X * Permission to use, copy, and distribute this software and its
  21. X * documentation for any purpose with or without fee is hereby granted, 
  22. X * provided that the above copyright notice appear in all copies and 
  23. X * that both that copyright notice and this permission notice appear 
  24. X * in supporting documentation.
  25. X *
  26. X * Permission to modify the software is granted, but not the right to
  27. X * distribute the modified code.  Modifications are to be distributed 
  28. X * as patches to released version.
  29. X *  
  30. X * This software  is provided "as is" without express or implied warranty.
  31. X * 
  32. X *
  33. X * AUTHORS
  34. X * 
  35. X *   Original Software:
  36. X *     Thomas Williams,  Colin Kelley.
  37. X * 
  38. X *   Gnuplot 2.0 additions:
  39. X *       Russell Lang, Dave Kotz, John Campbell.
  40. X * 
  41. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  42. X * 
  43. X */
  44. *-*-END-of-Copyright-*-*
  45. echo x - README
  46. sed 's/^X//' >README <<'*-*-END-of-README-*-*'
  47. XThe GNUPLOT source code and executables may be copied and/or modified
  48. Xfreely as long as the copyright messages are left intact.
  49. X
  50. XCompilation instructions are near the end of this file.
  51. X
  52. XGNUPLOT has been tested on Sun3's and Sun4's (SunOS 4.0.3), a Pyramid
  53. X90x (OSx 4.0 - ucb 4.3 and att V), a VAX 6410 (VMS 5.2), IBM PC XT's
  54. Xand AT's (MS-DOS 3.3, Microsoft C 5.10 and Turbo C 2.0)), IRIS 4D/70G
  55. Xand 4D/25G with MIPS C, and NeXT with gnu C 1.34.  The code is written
  56. Xwith portability in mind.
  57. X
  58. XIf you have problems, send mail to pixar!info-gnuplot@sun.com.  And
  59. Xplease send any modifications you make so they can be considered for
  60. Xlater releases.
  61. X
  62. X
  63. X                     GNUPLOT 2.0 RELEASE NOTES
  64. X
  65. XNew terminal drivers: Roland DXY800A, EEPIC, EPSON LX-800, Fig,
  66. XHP2648, HPGL, HP LaserJet, Imagen, Kermit-MS Tektronix emulator,
  67. XLaTeX, MCGA, NEC CP6 pinwriter, POSTSCRIPT, Proprinter, SUN, VGA.
  68. X
  69. XAdditions:
  70. X
  71. XCommand-line arguments are accepted. They are treated as names of
  72. Xfiles containing gnuplot commands. Gnuplot loads them, one by one, and
  73. Xthen exits.
  74. X
  75. XCommand 'plot' now has a 'title' option to change the information in
  76. Xthe key.  The 'with' option can now specify line type and point type.
  77. X
  78. XCommand 'pause'.
  79. X
  80. XCommand 'replot' allows the addition of extra plots. 
  81. X
  82. XCommand 'save' now saves all the 'set' options, including the last
  83. Xplot command.
  84. X
  85. XCommand 'set autoscale' now accepts autoscaling on the x axis for data
  86. Xfiles. The default is autoscaling on both axes. 
  87. X
  88. XCommand 'set noclip' disables clipping of points near the border. 'set
  89. Xclip' reenables clipping. The default used to be 'clip', and is now
  90. X'noclip'. Clipping has also been extended to clip lines that extend
  91. Xoutside the borders: line plots are now clipped at the plot boundary.
  92. XFormerly, the line stopped at the last in-range data point.
  93. X
  94. XNumerical labelling at tic marks on x and y axes.  Command 'set
  95. Xformat' allows the format of the tic mark labels to be altered.
  96. XCommands 'set xtics' and 'set ytics' allow for alphanumeric labels and
  97. Xarbitrary tic positions. 
  98. X
  99. XCommand 'set grid' adds a grid between the tic marks.
  100. X
  101. XImproved key gives sample point or line types.  Key can be disabled
  102. Xwith the 'set nokey'. Key can be positioned anywhere. 
  103. X
  104. XCommand 'set label' allows the placement of arbitrary text labels and
  105. Xarrows. 
  106. X
  107. XCommand 'set polar' for polar plots.
  108. X
  109. XCommand 'set offsets' for reducing the plotted area.  Useful for polar
  110. Xplots.
  111. X
  112. XCommand 'set size' scales the displayed size of the plot.
  113. X
  114. XCommand 'set tics out' causes the tics to be drawn outwards from the
  115. Xborder.  Useful for impulse plots.
  116. X
  117. XCommand 'set title' places a text label above the plot.
  118. X
  119. XCommands 'set xlabel' and 'set ylabel' place text labels on the x and
  120. Xy axes respectively.  Some terminals will place the y label vertically
  121. Xupwards on the left of the plot, others place the label horizontally
  122. Xat the left of the plot.
  123. X
  124. XImproved tics on log scales.
  125. X
  126. XExtended comments: comments are allowed anywhere reasonable in the
  127. Xinput line, and continue to the end of the input line.
  128. X
  129. XLine continuation (with \) is added.
  130. X
  131. XNon-interactive use, through redirection or "load" command, is
  132. Ximproved. Error messages expanded to include file name and line
  133. Xnumber, and to reprint command line if not interactive.
  134. X
  135. XNew plotting styles 'linespoints' and 'dots'.
  136. X
  137. XBlank lines in data files denote "breaks". In lines and linespoints
  138. Xplot styles, this breaks the curve being drawn and begins at the next
  139. Xpoint, without changing the line or point types.
  140. X
  141. XCompletely new interactive help system that is similar to VMS help
  142. Xsystem. A printed manual can be obtained in LaTeX, troff, or nroff and
  143. Xis based on the same information as the interactive help.
  144. X
  145. XPC version now compiles with the large model so that gnuplot will
  146. Xcompile with the above additions!
  147. X
  148. XBug fixes include:
  149. X------------------
  150. XBug involving functions plotted on a logarithmic x axis is fixed. 
  151. X
  152. XErrors inside of loaded files now clean up and close files properly.
  153. X
  154. XNumbers of the form xxxxe+nn are now acceptable (+ sign caused error).
  155. X
  156. XTics are now place inside the borders (some were outside).
  157. X
  158. XReverse axes now work properly.
  159. X
  160. XCommand 'set output ""' used to crash.  
  161. X
  162. XVMS was closing stdout, so 'set output' code changed to avoid closing
  163. Xit.  VMS version of gnuplot now performs a SET TERM/NOWRAP itself.
  164. X
  165. XTerminal is now reset before closing output file, changing terminal
  166. Xtype or exiting gnuplot.
  167. X
  168. XSeveral old bugs have been superseded by new ones.
  169. X
  170. X
  171. X                            ACKNOWLEDGEMENTS
  172. X
  173. XThe Unix PC, polar, pause, and offset additions were by John Campbell.
  174. X(CAMPBELL@NAUVAX.bitnet)
  175. XThe Turbo C additions were by Bill Wilson.
  176. X(WILSON@NAUVAX.bitnet)
  177. XSome of the labelling improvements and combining of these additions 
  178. Xwere by Russell Lang.
  179. X(rjl@monu1.cc.monash.oz.au)
  180. XThe LaTeX driver, the help system, and some of the labelling
  181. Ximprovements were by David Kotz. 
  182. X(dfk@cs.duke.edu)
  183. XAnd of course, the vast majority of the program is by Colin Kelley
  184. Xand Thomas Williams.
  185. X(pixar!info-gnuplot@sun.com)
  186. X
  187. X
  188. X                      GNUPLOT 1.1 RELEASE NOTES
  189. X
  190. XNew terminal drivers: AED 512, BBN BitGraph, HP2623, POSTSCRIPT,
  191. XSelanar, Vectrix 384.  The PC version now supports Hercules and ATT
  192. X6300 monochrome graphics.  Thanks to those who sent these drivers in.
  193. X
  194. XNew commands: 'set dummy' and 'show dummy' to select the dummy
  195. Xvariable name; 'replot' to repeat the last 'plot' command.
  196. X
  197. XThe exclamation point (!) is now accepted as postfix factorial
  198. Xoperator.  The gamma() function is also included, if your C library
  199. Xhas gamma().  See GAMMA below.
  200. X
  201. XLogical AND (&&) and OR (||) now short-circuit the way they do in C.
  202. XThat is, the second && operand is not evaluated if the first is false;
  203. Xthe second || operand is not evaluated if the first is true.  The
  204. Xternary operator (?:) also does not evaluate the unused operand.  This
  205. Xchange allows for the definition of recursive functions, e.g. a
  206. Xsynonym for the ! factorial operator:
  207. X
  208. X    fact(x) = (x<=1) ? 1 : x*fact(x-1)
  209. X
  210. XGNUPLOT now has a much better memory allocation scheme, replacing most
  211. Xfixed-size arrays with malloc()'d linked lists.  There is no longer
  212. Xany artificial maximum on the number of simultaneous plots, number of
  213. Xpoints in those plots, or the number of user-defined functions or
  214. Xvariables.  All these are limited only by the memory available to
  215. Xmalloc().  This is a big improvement for memory-starved machines like
  216. XPDP-11s or PCs.
  217. X
  218. XLines beginning with # (also ! in VMS) are treated as comments.  Only
  219. Xthe $ may now be used for a shell escape in VMS, since ! is a comment.
  220. X
  221. XSeveral old bugs have been superseded by new ones.
  222. X
  223. X
  224. X                       PREPROCESSOR #DEFINES
  225. X
  226. XThese #defines should be checked before compilation:
  227. Xdefine        file                note
  228. X------      ----            --------
  229. XVFORK       Makefile        define if you've got vfork() system call
  230. XGAMMA       Makefile        define if you've got gamma(3)
  231. XBCOPY       Makefile        define if your memcpy() is called bcopy()
  232. XBZERO       Makefile        define if you have bzero() but not memset()
  233. XNOCOPY      Makefile        define if you've don't have a memcpy() by any name
  234. Xbcopy()     plot.h          define if you've got a memcpy() by some OTHER name
  235. X                              (see example in plot.h)
  236. XPC          Makefile        define if compiling on a PClone
  237. XMSDOS       Makefile        define if compiling under MSDOS;
  238. X                              automatically defined by Microsoft C 5.10
  239. XHELPFILE    Makefile        name including path of gnuplot.gih file.
  240. XVERYLARGE   plot.h          define to be largest coordinate number.
  241. XSHELL       plot.h          default shell to spawn if SHELL environment
  242. X                              variable not found at run-time
  243. X
  244. XValid TERMFLAGS defines.  These defines are used to include the
  245. Xvarious plotting terminals, printers, and protocols that a given version
  246. Xof gnuplot can access:
  247. X
  248. Xdefine         file        note
  249. X------      ----            --------
  250. XTERMFLAGS   Makefile        the set of terminals you want, from below
  251. X
  252. X   AED         AED 512 and AED 767
  253. X   BITGRAPH    BBN BitGraph
  254. X   DXY800A     Roland DXY800A plotter
  255. X   EPSON       Epson LX-800, Star NL-10, NX-1000 and lots of others
  256. X   FIG         Fig graphics language (requires object.h from TransFig)
  257. X   HP2648      HP2648, HP2647
  258. X   HP26        HP2623A and maybe others
  259. X   HP75        HP7580, and probably other HPs
  260. X   HPGL        HP7475 and (hopefully) lots of others
  261. X   HPLJET      HP Laserjet
  262. X   IMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  263. X   IRIS4D      IRIS4D series computer
  264. X   KERMIT      MS-Kermit Tektronix 4010 emulator
  265. X   LATEX       LATEX picture environment
  266. X   NEC         NEC CP6 pinwriter printer
  267. X   POSTSCRIPT  Postscript
  268. X   PROPRINTER  IBM Proprinter
  269. X   QMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  270. X   REGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  271. X   SELANAR     Selanar
  272. X   TEK         Tektronix 4010, and probably others
  273. X   SUN         Sun Microsystems Workstation
  274. X   UNIXPC      unixpc (ATT 3b1 or ATT 7300)
  275. X   UNIXPLOT    unixplot
  276. X   V384        Vectrix 384 and tandy color printer
  277. X
  278. X
  279. XThese #defines are defined automatically by various compilers, some
  280. Xgnuplot routines check these defines to implement features found in the
  281. Xvarious environments:
  282. X
  283. Xdefine         note
  284. X------      --------
  285. Xvms         (and VMS) defined by VAX-11 C under VMS.
  286. X
  287. X__TURBOC__  defined automatically by Turbo C 2.0
  288. X__ZTC__        defined automatically by Zortech C
  289. X
  290. X
  291. X                             TO COMPILE
  292. X
  293. Xunder UNIX:  
  294. XTo compile do:
  295. X    cp makefile.unx Makefile
  296. X    (make any changes to #defines, especially HELPDEST and TERMFLAGS)
  297. X    make
  298. X
  299. Xunder VMS:  
  300. X To compile:
  301. X     copy makefile.vms makefile.
  302. X     make
  303. X Or if you don't have a suitable make:
  304. X     @buildvms
  305. X To tell gnuplot where to find the help library:
  306. X      $ define gnuplot$help disk:[directory]gnuplot.hlb
  307. X  Alternatively (and preferably) put the help in the main system help library.
  308. X
  309. Xunder MSDOS:
  310. XUsing Microsoft C 5.10.
  311. X    make makefile.msc
  312. X
  313. XUsing Turbo C 2.0.
  314. X    make -fmakefile.tc
  315. X
  316. XThe file gnuplot.gih is needed for help on the PC.
  317. XIf the file gnuplot.gih is not in the default directory, then use:
  318. X    set GNUHELP={full path name of gnuplot.gih}
  319. X
  320. XThe Zortech C++ compiler has been used to compile gnuplot, but
  321. Xit has not been tested.  The Microsoft MASM and linker are needed.
  322. X
  323. X
  324. X                         ENVIRONMENT VARIABLES
  325. X
  326. XIf the environment variable GNUTERM is found, it is used as the terminal
  327. Xtype. Otherwise, in some cases the variable TERM will be used, or the
  328. Xhardware may be automatically detected. 
  329. X
  330. XThe PC version looks for the environment variable GNUPLOT to contain
  331. Xthe name of the directory from which to load the initialization file
  332. XGNUPLOT.INI.  See the help on 'start_up' for more information.
  333. X
  334. XHOME is examined as a directory where a .gnuplot startup file might be
  335. Xfound. See help on "start-up".
  336. X
  337. XIf defined, the environment variable GNUHELP is used for the name
  338. Xof the .gih help file, otherwise HELPFILE (defined in makefile or 
  339. Xplot.c) is used.
  340. X
  341. XThe VMS version looks for the logical name GNUPLOT$HELP to locate 
  342. Xthe help library.
  343. *-*-END-of-README-*-*
  344. echo x - README.gnutex
  345. sed 's/^X//' >README.gnutex <<'*-*-END-of-README.gnutex-*-*'
  346. XA note to former Gnutex users, from David Kotz (dfk@cs.duke.edu).
  347. X-----------------------------------------------------------------
  348. X
  349. XMarch 4, 1990
  350. X
  351. XI am happy to be a part of GNUPLOT 2.0, and I believe that it is a
  352. Xmuch improved program from its various predecessors. Many aspects of
  353. Xgnutex 1.6 made it into GNUPLOT 2.0. Unfortunately for those of us who
  354. Xhave a lot of gnutex input files around, not everything from gnutex is
  355. Xsupported by GNUPLOT. To help gnutex users with the process of
  356. Xadapting to GNUPLOT (and I recommend it), I have included a section in
  357. Xthe LaTeX/GNUPLOT tutorial (in ./docs/latextut/) about the
  358. Xdifferences, and written a translator program (in ./translate/).
  359. XPlease read the LaTeX/GNUPLOT tutorial.
  360. X
  361. XUsers of gnutex that did not use the LaTeX driver will probably have
  362. Xlittle difficulty adapting. 
  363. X
  364. XPlease send all comments, complaints, and suggestions on this subject
  365. Xto dfk@cs.duke.edu.
  366. *-*-END-of-README.gnutex-*-*
  367. echo x - makefile.unx
  368. sed 's/^X//' >makefile.unx <<'*-*-END-of-makefile.unx-*-*'
  369. X#
  370. X# GNUPLOT Makefile
  371. X#
  372. X
  373. X# directory where to install executables on 'make install'
  374. XDEST=/usr/local/bin
  375. X# directory for installing man page on 'make man_install'
  376. XMANDEST=/usr/man/manl
  377. X# where to install help file gnuplot.gih
  378. X#HELPDEST=/usr/local/lib/gnuplot.gih
  379. XHELPDEST=docs/gnuplot.gih
  380. X# Where to send email about bugs and comments (locally)
  381. XEMAIL=\"pixar\!bug-gnuplot@sun.com\"
  382. X
  383. X# -DVFORK if you have vfork()
  384. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  385. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset() 
  386. X# -DNOCOPY if you don't have a memcpy() by any name
  387. X# -DGAMMA if you've got gamma(3)
  388. X# -fswitch if you are compiling on a Sun3 (or even -f68881)
  389. X# -O if you trust your compiler's optimizer
  390. XCFLAGS = -DVFORK -DBCOPY -DBZERO -DGAMMA #-gx #-O
  391. X
  392. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  393. X# -DAED         AED 512 and AED 767
  394. X# -DBITGRAPH    BBN BitGraph
  395. X# -DDXY800A     Roland DXY800A plotter
  396. X# -DEEPIC           EEPIC-extended LaTeX driver, for EEPIC users
  397. X# -DEPSON        Epson LX-800, Star NL-10, NX-1000 and lots of others
  398. X# -DFIG           Fig graphics language (requires object.h from TransFig)
  399. X# -DHP2648        HP2648, HP2647
  400. X# -DHP26        HP2623A and maybe others
  401. X# -DHP75        HP7580, and probably other HPs
  402. X# -DHPGL        HP7475, HP7220 plotters, and (hopefully) lots of others
  403. X# -DHPLJET        HP Laserjet
  404. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  405. X# -DIRIS4D      IRIS4D series computer
  406. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  407. X# -DLATEX       LATEX picture environment
  408. X# -DNEC         NEC CP6 pinwriter printer
  409. X# -DPOSTSCRIPT  Postscript
  410. X# -DPROPRINTER  IBM Proprinter
  411. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  412. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  413. X# -DSELANAR     Selanar
  414. X# -DTEK         Tektronix 4010, and probably others
  415. X# -DSUN         Sun Microsystems Workstation
  416. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  417. X# -DUNIXPLOT    unixplot
  418. X# -DV384        Vectrix 384 and tandy color printer
  419. X
  420. XTERMFLAGS =  -Iterm -DAED -DBITGRAPH -DDXY800A -DEPSON -DHP2648 \
  421. X    -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX -DEEPIC \
  422. X    -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
  423. X    -DUNIXPLOT -DV384 
  424. X
  425. XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
  426. X    plot.o scanner.o setshow.o standard.o term.o util.o 
  427. X
  428. XDIRS = term demo bugtest docs docs/latextut translate
  429. XCSOURCE1 = command.c setshow.c 
  430. XCSOURCE2 = help.c graphics.c internal.c 
  431. XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c 
  432. XCSOURCE4 = term.c util.c version.c
  433. XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
  434. X    term/hp26.trm term/hp2648.trm term/hpgl.trm \
  435. X    term/hpljet.trm term/iris4d.trm term/sun.trm
  436. XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
  437. X    term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm
  438. XCSOURCE7 = term/imPcodes.h term/imagen.trm term/object.h term/fig.trm \
  439. X    term/latex.trm term/eepic.trm
  440. X# not C code, but still needed
  441. XETC = Copyright README README.gnutex makefile.unx makefile.vms  \
  442. X    makefile.3b1 makefile.ult plot.h help.h setshow.h lasergnu \
  443. X     demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
  444. X    demo/simple.demo demo/polar.demo demo/electron.demo \
  445. X    bugtest/README bugtest/printf.c bugtest/scanf.c \
  446. X    bugtest/mscbug.c term/README \
  447. X    linkopt.vms buildvms.com
  448. X# PC-specific files
  449. XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
  450. X    linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm 
  451. X# Documentation and help files
  452. XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
  453. X    docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
  454. X    docs/gnuplot.1 docs/lasergnu.1 \
  455. X    docs/titlepage.ms docs/titlepage.tex
  456. XDOCS2 = docs/gnuplot.doc
  457. XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
  458. X    docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
  459. X    docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
  460. X    docs/latextut/header.tex docs/latextut/tutorial.tex
  461. X# gnutex->gnuplot translator
  462. XTSOURCE1 = translate/Makefile translate/README translate/command.c \
  463. X    translate/eval.c translate/gnut2p.1 translate/internal.c \
  464. X    translate/misc.c translate/parse.c translate/plot.c
  465. XTSOURCE2 = \
  466. X    translate/plot.h translate/scanner.c translate/standard.c \
  467. X    translate/test1 translate/test2 translate/util.c
  468. X
  469. X# -lplot if you have -DUNIXPLOT
  470. X# -lsuntool -lsunwindow -lpixrect  if you have -DSUN
  471. X# -lgl_s if IRIS4D
  472. XLIBS = -lm -lplot
  473. X
  474. Xgnuplot: $(OBJS) version.o
  475. X    cc $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot
  476. X
  477. Xdoc:
  478. X    ( cd docs; make gnuplot.gih )
  479. X
  480. Xtranslate:
  481. X    (cd translate; make)
  482. X
  483. Xall:    gnuplot doc
  484. X
  485. Xinstall: gnuplot doc man_install
  486. X    cp gnuplot lasergnu $(DEST)
  487. X    strip $(DEST)/gnuplot
  488. X    (cd docs; make install-unix HELPDEST=$(HELPDEST))
  489. X
  490. Xman_install: docs/gnuplot.1 docs/lasergnu.1
  491. X    cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
  492. X
  493. Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  494. X    cc $(CFLAGS) $(TERMFLAGS) -c term.c
  495. X
  496. Xversion.o:
  497. X    cc $(CFLAGS) -DCONTACT=$(EMAIL) -c version.c
  498. X
  499. X$(OBJS): plot.h
  500. X
  501. Xcommand.o:
  502. X    cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
  503. X
  504. Xcommand.o help.o misc.o: help.h
  505. X
  506. Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
  507. X
  508. XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
  509. X    $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  510. X
  511. Xlint:
  512. X    lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
  513. X
  514. Xclean:
  515. X    rm -f *.o *~ term/*~
  516. X    (cd docs; make clean)
  517. X    (cd docs/latextut; make clean)
  518. X    (cd translate; make clean)
  519. X
  520. Xspotless:
  521. X    rm -f *.o *~ term/*~ TAGS gnuplot
  522. X    (cd docs; make clean)
  523. X    (cd docs/latextut; make spotless)
  524. X    (cd translate; make spotless)
  525. X
  526. Xshar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
  527. X    gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
  528. X    gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
  529. X    gnuplot.sh13 gnuplot.sh14
  530. X
  531. Xgnuplot.sh00:
  532. X    echo '#!/bin/sh' > gnuplot.sh00
  533. X    echo '# This is a shell file to make directories' >> gnuplot.sh00
  534. X    echo mkdir $(DIRS) >> gnuplot.sh00
  535. X
  536. Xgnuplot.sh01: $(ETC)
  537. X    shar $(ETC) > gnuplot.sh01
  538. X
  539. Xgnuplot.sh02: $(DOCS1)
  540. X    shar $(DOCS1) > gnuplot.sh02
  541. X
  542. Xgnuplot.sh03: $(DOCS2)
  543. X    shar $(DOCS2) > gnuplot.sh03
  544. X
  545. Xgnuplot.sh04: $(DOCS3)
  546. X    shar $(DOCS3) > gnuplot.sh04
  547. X
  548. Xgnuplot.sh05: $(CSOURCE1)
  549. X    shar $(CSOURCE1) > gnuplot.sh05
  550. X
  551. Xgnuplot.sh06: $(CSOURCE2)
  552. X    shar $(CSOURCE2) > gnuplot.sh06
  553. X
  554. Xgnuplot.sh07: $(CSOURCE3)
  555. X    shar $(CSOURCE3) > gnuplot.sh07
  556. X
  557. Xgnuplot.sh08: $(CSOURCE4)
  558. X    shar $(CSOURCE4) > gnuplot.sh08
  559. X
  560. Xgnuplot.sh09: $(CSOURCE5)
  561. X    shar $(CSOURCE5) > gnuplot.sh09
  562. X
  563. Xgnuplot.sh10: $(CSOURCE6)
  564. X    shar $(CSOURCE6) > gnuplot.sh10
  565. X
  566. Xgnuplot.sh11: $(CSOURCE7)
  567. X    shar $(CSOURCE7) > gnuplot.sh11
  568. X
  569. Xgnuplot.sh12: $(PC)
  570. X    shar $(PC) > gnuplot.sh12
  571. X
  572. Xgnuplot.sh13: $(TSOURCE1)
  573. X    shar $(TSOURCE1) > gnuplot.sh13
  574. X
  575. Xgnuplot.sh14: $(TSOURCE2)
  576. X    shar $(TSOURCE2) > gnuplot.sh14
  577. X
  578. *-*-END-of-makefile.unx-*-*
  579. echo x - makefile.vms
  580. sed 's/^X//' >makefile.vms <<'*-*-END-of-makefile.vms-*-*'
  581. X#
  582. X# GNUPLOT Makefile
  583. X# for VMS
  584. X# 
  585. X# use with the MAKE that was posted by Tony Ivanov (tony@gvgpvd.GVG.TEK.COM)
  586. X# in comp.os.vms on 5 December 1988
  587. X#
  588. X
  589. X# NOOP  NO Optimiser
  590. XCFLAGS = /NOOP
  591. X
  592. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  593. X# -DAED         AED 512 and AED 767
  594. X# -DBITGRAPH    BBN BitGraph
  595. X# -DDXY800A     Roland DXY800A plotter
  596. X# -DEPSON       Epson LX-800, Star NL-10, NX-1000 and lots of others
  597. X# -DFIG         Fig graphics language (requires object.h from TransFig)
  598. X# -DHP2648      HP2648, HP2647
  599. X# -DHP26        HP2623A and maybe others
  600. X# -DHP75        HP7580, and probably other HPs
  601. X# -DHPGL        HP7475 and (hopefully) lots of others
  602. X# -DHPLJET      HP Laserjet
  603. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  604. X# -DIRIS4D      IRIS4D series computer
  605. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  606. X# -DLATEX       LATEX picture environment
  607. X# -DPOSTSCRIPT  Postscript
  608. X# -DPROPRINTER  IBM Proprinter
  609. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  610. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  611. X# -DSELANAR     Selanar
  612. X# -DTEK         Tektronix 4010, and probably others
  613. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  614. X# -DUNIXPLOT    unixplot
  615. X# -DV384        Vectrix 384 and tandy color printer
  616. X
  617. X
  618. XTERMFLAGS = /define=(AED,BITGRAPH,DXY800A,HP2648,HP26,HP75,HPGL, \
  619. X    KERMIT,LATEX,POSTSCRIPT,QMS,REGIS,SELANAR,TEK,V384)
  620. X
  621. XOBJS =  command.obj,eval.obj,graphics.obj,internal.obj, \
  622. X        misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, \
  623. X        standard.obj,term.obj,util.obj,version.obj
  624. X
  625. XCSOURCE1 = command.c setshow.c
  626. XCSOURCE2 = help.c graphics.c internal.c
  627. XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
  628. XCSOURCE4 = term.c util.c version.c
  629. XCSOURCE5 = [.term]aed.trm [.term]dxy.trm [.term]epson.trm [.term]font5x7.trm  \
  630. X        [.term]hp26.trm [.term]hp2648.trm [.term]hpgl.trm  \
  631. X        [.term]hpljet.trm [.term]iris4d.trm [.term]latex.trm
  632. XCSOURCE6 = [.term]post.trm [.term]pc.trm [.term]qms.trm [.term]regis.trm  \
  633. X        [.term]tek.trm [.term]unixpc.trm [.term]unixplot.trm [.term]v384.trm  \
  634. X        [.term]imPcodes.h [.term]imagen.trm [.term]object.h [.term]fig.trm
  635. X
  636. X
  637. Xall :   gnuplot.exe gnuplot.hlp gnuplot.hlb
  638. X
  639. X
  640. Xgnuplot.exe : $(OBJS)
  641. X        link /exe=gnuplot $(OBJS) ,linkopt.vms/opt
  642. X
  643. Xgnuplot.hlp : doc2hlp.exe [.docs]gnuplot.doc [.docs]doc2hlp.com
  644. X        $$@[.docs]doc2hlp.com
  645. X
  646. Xgnuplot.hlb : gnuplot.hlp
  647. X    library/create/help gnuplot.hlb gnuplot.hlp
  648. X
  649. Xdoc2hlp.exe: [.docs]doc2hlp.c
  650. X        cc [.docs]doc2hlp.c
  651. X        link doc2hlp,linkopt.vms/opt
  652. X
  653. Xterm.obj : $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
  654. X        cc $(CFLAGS) $(TERMFLAGS) term.c
  655. X
  656. X$(OBJS) : plot.h
  657. X
  658. Xcommand.obj help.obj misc.obj : help.h
  659. X
  660. Xcommand.obj graphics.obj misc.obj plot.obj setshow.obj : setshow.h
  661. X
  662. Xclean :
  663. X        purge/log
  664. X        del/log *.obj;*
  665. *-*-END-of-makefile.vms-*-*
  666. echo x - makefile.3b1
  667. sed 's/^X//' >makefile.3b1 <<'*-*-END-of-makefile.3b1-*-*'
  668. X#
  669. X# GNUPLOT Makefile for ATT 3b1 (ATT 7300 or the "unix-PC")
  670. X#
  671. X# Note: this makefile uses the shared library
  672. X#
  673. X
  674. X# directory where to install executables on 'make install'
  675. XDEST=/usr/local/bin
  676. X# directory for installing man page on 'make man_install'
  677. XMANDEST=/usr/man/manl
  678. X# where to install help file gnuplot.gih
  679. X#HELPDEST=/usr/local/lib/gnuplot.gih
  680. XHELPDEST=docs/gnuplot.gih
  681. X
  682. X# -DVFORK if you have vfork()
  683. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  684. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  685. X# -DNOCOPY if you don't have a memcpy() by any name
  686. X# -DGAMMA if you've got gamma(3)
  687. X# -O if you trust your compiler's optimizer
  688. XCC = cc
  689. XCFLAGS = -DGAMMA -O #-g
  690. X
  691. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  692. X# -DAED         AED 512 and AED 767
  693. X# -DBITGRAPH    BBN BitGraph
  694. X# -DDXY800A     Roland DXY800A plotter
  695. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  696. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  697. X# -DHP2648              HP2648, HP2647
  698. X# -DHP26        HP2623A and maybe others
  699. X# -DHP75        HP7580, and probably other HPs
  700. X# -DHPGL                HP7475 and (hopefully) lots of others
  701. X# -DHPLJET              HP Laserjet
  702. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  703. X# -DIRIS4D      IRIS4D series computer
  704. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  705. X# -DLATEX       LATEX picture environment
  706. X# -DPOSTSCRIPT  Postscript
  707. X# -DPROPRINTER  IBM Proprinter
  708. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  709. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  710. X# -DSELANAR     Selanar
  711. X# -DTEK         Tektronix 4010, and probably others
  712. X# -DSUN         Sun Microsystems Workstation
  713. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  714. X# -DUNIXPLOT    unixplot
  715. X# -DV384        Vectrix 384 and tandy color printer
  716. X
  717. XTERMFLAGS =  -Iterm -DNEC -DUNIXPLOT -DUNIXPC
  718. X
  719. XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
  720. X    plot.o scanner.o setshow.o standard.o term.o util.o
  721. X
  722. XDIRS = term demo bugtest docs docs/latextut translate
  723. XCSOURCE1 = command.c setshow.c
  724. XCSOURCE2 = help.c graphics.c internal.c
  725. XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
  726. XCSOURCE4 = term.c util.c version.c
  727. XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
  728. X    term/hp26.trm term/hp2648.trm term/hpgl.trm \
  729. X    term/hpljet.trm term/iris4d.trm term/latex.trm term/sun.trm
  730. XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
  731. X    term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm \
  732. X    term/imPcodes.h term/imagen.trm term/object.h term/fig.trm
  733. X# not C code, but still needed
  734. XETC = README README.gnutex makefile.unx makefile.vms linkopt.vms \
  735. X    makefile.3b1 plot.h help.h setshow.h lasergnu \
  736. X    demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
  737. X    demo/simple.demo demo/polar.demo demo/electron.demo \
  738. X    bugtest/README bugtest/printf.c bugtest/scanf.c \
  739. X    bugtest/mscbug.c term/README
  740. X# PC-specific files
  741. XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
  742. X    linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm
  743. X# Documentation and help files
  744. XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
  745. X    docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
  746. X    docs/gnuplot.1 docs/lasergnu.1 \
  747. X    docs/titlepage.ms docs/titlepage.tex
  748. XDOCS2 = docs/gnuplot.doc
  749. XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
  750. X    docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
  751. X    docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
  752. X    docs/latextut/header.tex docs/latextut/tutorial.tex
  753. X# gnutex->gnuplot translator
  754. XTSOURCE1 = translate/Makefile translate/README translate/command.c \
  755. X    translate/eval.c translate/gnut2p.1 translate/internal.c \
  756. X    translate/misc.c translate/parse.c translate/plot.c \
  757. X    translate/plot.h translate/scanner.c translate/standard.c \
  758. X    translate/test1 translate/test2 translate/util.c
  759. X
  760. X# -lplot iff you have -DUNIXPLOT
  761. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  762. X# -lgl_s if IRIS4D
  763. XLIBS = -lm -lplot
  764. X
  765. Xgnuplot: $(OBJS) version.o
  766. X    ld /lib/crt0s.o /lib/shlib.ifile $(OBJS) version.o $(LIBS) -o gnuplot
  767. X
  768. Xdoc:
  769. X    ( cd docs; make gnuplot.gih )
  770. X
  771. Xtranslate:
  772. X    (cd translate; make)
  773. X
  774. Xall:    gnuplot doc
  775. X
  776. Xinstall: gnuplot doc man_install
  777. X    cp gnuplot lasergnu $(DEST)
  778. X    strip $(DEST)/gnuplot
  779. X    (cd docs; make install-unix HELPDEST=$(HELPDEST))
  780. X
  781. Xman_install: docs/gnuplot.1 docs/lasergnu.1
  782. X    cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
  783. X
  784. Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
  785. X    $(CC) $(CFLAGS) $(TERMFLAGS) -c term.c
  786. X
  787. X$(OBJS): plot.h
  788. X
  789. Xcommand.o:
  790. X    cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
  791. X
  792. Xcommand.o help.o misc.o: help.h
  793. X
  794. Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
  795. X
  796. XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
  797. X    $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
  798. X
  799. Xlint:
  800. X    lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
  801. X
  802. Xclean:
  803. X    rm -f *.o *~ term/*~
  804. X    (cd docs; make clean)
  805. X    (cd docs/latextut; make clean)
  806. X    (cd translate; make clean)
  807. X
  808. Xspotless:
  809. X    rm -f *.o *~ term/*~ TAGS gnuplot
  810. X    (cd docs; make clean)
  811. X    (cd docs/latextut; make spotless)
  812. X    (cd translate; make spotless)
  813. *-*-END-of-makefile.3b1-*-*
  814. echo x - makefile.ult
  815. sed 's/^X//' >makefile.ult <<'*-*-END-of-makefile.ult-*-*'
  816. X#
  817. X# GNUPLOT Makefile for Ultrix
  818. X#
  819. X# Note: Ultrix standard cc compiler has a bug with static structure
  820. X# initializations [such as struct ts {int x;} tb[]={{100*0.32}};]
  821. X# and so this makefile uses vcc instead.  If this isn't possible,
  822. X# and you get "line xx: illegal initialization", then you'll have
  823. X# to go into the .trm include file and compute all the floating point
  824. X# defines with a calculator.
  825. X
  826. X# directory where to install executables on 'make install'
  827. XDEST=/usr/local/bin
  828. X# directory for installing man page on 'make man_install'
  829. XMANDEST=/usr/man/manl
  830. X# where to install help file gnuplot.gih
  831. X#HELPDEST=/usr/local/lib/gnuplot.gih
  832. XHELPDEST=docs/gnuplot.gih
  833. X
  834. X# -DVFORK if you have vfork()
  835. X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  836. X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
  837. X# -DNOCOPY if you don't have a memcpy() by any name
  838. X# -DGAMMA if you've got gamma(3)
  839. X# -O if you trust your compiler's optimizer
  840. XCFLAGS = -DVFORK -DBCOPY -DBZERO -DGAMMA -O #-gx 
  841. X
  842. X# Not wise to use vcc for everything because math.h isn't compatible with
  843. X# vcc.  (How can they get away with this?)
  844. X#CC = vcc
  845. X
  846. X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  847. X# -DAED         AED 512 and AED 767
  848. X# -DBITGRAPH    BBN BitGraph
  849. X# -DDXY800A     Roland DXY800A plotter
  850. X# -DEPSON               Epson LX-800, Star NL-10, NX-1000 and lots of others
  851. X# -DFIG                 Fig graphics language (requires object.h from TransFig)
  852. X# -DHP2648              HP2648, HP2647
  853. X# -DHP26        HP2623A and maybe others
  854. X# -DHP75        HP7580, and probably other HPs
  855. X# -DHPGL                HP7475 and (hopefully) lots of others
  856. X# -DHPLJET              HP Laserjet
  857. X# -DIMAGEN      Imagen laser printers (300dpi) (requires -Iterm also)
  858. X# -DIRIS4D      IRIS4D series computer
  859. X# -DKERMIT      MS-Kermit Tektronix 4010 emulator
  860. X# -DLATEX       LATEX picture environment
  861. X# -DPOSTSCRIPT  Postscript
  862. X# -DPROPRINTER  IBM Proprinter
  863. X# -DQMS         QMS/QUIC laserprinter (Talaris 1200 and others)
  864. X# -DREGIS       ReGis graphics (vt125, vt220, vt240, Gigis...)
  865. X# -DSELANAR     Selanar
  866. X# -DTEK         Tektronix 4010, and probably others
  867. X# -DSUN         Sun Microsystems Workstation
  868. X# -DUNIXPC      unixpc (ATT 3b1 or ATT 7300)
  869. X# -DUNIXPLOT    unixplot
  870. X# -DV384        Vectrix 384 and tandy color printer
  871. X
  872. XTERMFLAGS =  -Iterm -DAED -DBITGRAPH -DDXY800A -DEPSON -DHP2648 \
  873. X    -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX \
  874. X    -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
  875. X    -DUNIXPLOT -DV384
  876. X
  877. X#TERMFLAGS =  -Iterm -DIMAGEN
  878. X
  879. XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
  880. X    plot.o scanner.o setshow.o standard.o term.o util.o
  881. X
  882. XDIRS = term demo bugtest docs docs/latextut translate
  883. XCSOURCE1 = command.c setshow.c
  884. XCSOURCE2 = help.c graphics.c internal.c
  885. XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
  886. XCSOURCE4 = term.c util.c version.c
  887. XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
  888. X    term/hp26.trm term/hp2648.trm term/hpgl.trm \
  889. X    term/hpljet.trm term/iris4d.trm term/latex.trm term/sun.trm
  890. XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
  891. X    term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm \
  892. X    term/imPcodes.h term/imagen.trm term/object.h term/fig.trm
  893. X# not C code, but still needed
  894. XETC = README README.gnutex makefile.unx makefile.vms linkopt.vms \
  895. X    makefile.3b1 plot.h help.h setshow.h lasergnu \
  896. X    demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
  897. X    demo/simple.demo demo/polar.demo demo/electron.demo \
  898. X    bugtest/README bugtest/printf.c bugtest/scanf.c \
  899. X    bugtest/mscbug.c term/README
  900. X# PC-specific files
  901. XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
  902. X    linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm
  903. X# Documentation and help files
  904. XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
  905. X    docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
  906. X    docs/gnuplot.1 docs/lasergnu.1 \
  907. X    docs/titlepage.ms docs/titlepage.tex
  908. XDOCS2 = docs/gnuplot.doc
  909. XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
  910. X    docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
  911. X    docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
  912. X    docs/latextut/header.tex docs/latextut/tutorial.tex
  913. X# gnutex->gnuplot translator
  914. XTSOURCE1 = translate/Makefile translate/README translate/command.c \
  915. X    translate/eval.c translate/gnut2p.1 translate/internal.c \
  916. X    translate/misc.c translate/parse.c translate/plot.c \
  917. X    translate/plot.h translate/scanner.c translate/standard.c \
  918. X    translate/test1 translate/test2 translate/util.c
  919. X
  920. X# -lplot iff you have -DUNIXPLOT
  921. X# -lsuntool -lsunwindow -lpixrect  iff you have -DSUN
  922. X# -lgl_s if IRIS4D
  923. XLIBS = -lm -lplot
  924. X
  925. Xgnuplot: $(OBJS) version.o
  926. X    vcc $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot
  927. X
  928. Xdoc:
  929. X    ( cd docs; make gnuplot.gih )
  930. X
  931. Xtranslate:
  932. X    (cd translate; make)
  933. X
  934. Xall:    gnuplot doc
  935. X
  936. Xinstall: gnuplot doc man_install
  937. X    cp gnuplot lasergnu $(DEST)
  938. X    strip $(DEST)/gnuplot
  939. X    (cd docs; make install-unix HELPDEST=$(HELPDEST))
  940. X
  941. Xman_install: docs/gnuplot.1 docs/lasergnu.1
  942. X    cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
  943. X
  944. Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
  945. X    vcc $(CFLAGS) $(TERMFLAGS) -c term.c
  946. X
  947. X$(OBJS): plot.h
  948. X
  949. Xcommand.o:
  950. X    cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
  951. X
  952. Xcommand.o help.o misc.o: help.h
  953. X
  954. Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
  955. X
  956. XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
  957. X    $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
  958. X
  959. Xlint:
  960. X    lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
  961. X
  962. Xclean:
  963. X    rm -f *.o *~ term/*~
  964. X    (cd docs; make clean)
  965. X    (cd docs/latextut; make clean)
  966. X    (cd translate; make clean)
  967. X
  968. Xspotless:
  969. X    rm -f *.o *~ term/*~ TAGS gnuplot
  970. X    (cd docs; make clean)
  971. X    (cd docs/latextut; make spotless)
  972. X    (cd translate; make spotless)
  973. *-*-END-of-makefile.ult-*-*
  974. echo x - plot.h
  975. sed 's/^X//' >plot.h <<'*-*-END-of-plot.h-*-*'
  976. X/* GNUPLOT - plot.h */
  977. X/*
  978. X * Copyright (C) 1986, 1987, 1990   Thomas Williams, Colin Kelley
  979. X *
  980. X * Permission to use, copy, and distribute this software and its
  981. X * documentation for any purpose with or without fee is hereby granted, 
  982. X * provided that the above copyright notice appear in all copies and 
  983. X * that both that copyright notice and this permission notice appear 
  984. X * in supporting documentation.
  985. X *
  986. X * Permission to modify the software is granted, but not the right to
  987. X * distribute the modified code.  Modifications are to be distributed 
  988. X * as patches to released version.
  989. X *  
  990. X * This software  is provided "as is" without express or implied warranty.
  991. X * 
  992. X *
  993. X * AUTHORS
  994. X * 
  995. X *   Original Software:
  996. X *     Thomas Williams,  Colin Kelley.
  997. X * 
  998. X *   Gnuplot 2.0 additions:
  999. X *       Russell Lang, Dave Kotz, John Campbell.
  1000. X * 
  1001. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1002. X * 
  1003. X */
  1004. X
  1005. X
  1006. X#define PROGRAM "G N U P L O T"
  1007. X#define PROMPT "gnuplot> "
  1008. X#define SHELL "/bin/sh"        /* used if SHELL env variable not set */
  1009. X
  1010. X#define SAMPLES 160        /* default number of samples for a plot */
  1011. X#define ZERO    1e-8        /* default for 'zero' set option */
  1012. X
  1013. X#ifndef TERM
  1014. X/* default terminal is "unknown"; but see init_terminal */
  1015. X#define TERM "unknown"
  1016. X#endif
  1017. X
  1018. X#define TRUE 1
  1019. X#define FALSE 0
  1020. X
  1021. X
  1022. X#define Pi 3.141592653589793
  1023. X
  1024. X
  1025. X#define MAX_POINTS 1
  1026. X#define MAX_LINE_LEN 1024    /* maximum number of chars allowed on line */
  1027. X#define MAX_TOKENS 200
  1028. X#define MAX_ID_LEN 50        /* max length of an identifier */
  1029. X
  1030. X
  1031. X#define MAX_AT_LEN 150        /* max number of entries in action table */
  1032. X#define STACK_DEPTH 100
  1033. X#define NO_CARET (-1)
  1034. X
  1035. X
  1036. X
  1037. X
  1038. X#ifdef vms
  1039. X#define OS "VMS "
  1040. X#endif
  1041. X
  1042. X
  1043. X#ifdef unix
  1044. X#define OS "unix "
  1045. X#endif
  1046. X
  1047. X
  1048. X#ifdef MSDOS
  1049. X#define OS "MS-DOS "
  1050. X#endif
  1051. X
  1052. X
  1053. X#ifndef OS
  1054. X#define OS ""
  1055. X#endif
  1056. X
  1057. X
  1058. X/*
  1059. X * Note about VERYLARGE:  This is the upper bound double (or float, if PC)
  1060. X * numbers. This flag indicates very large numbers. It doesn't have to 
  1061. X * be the absolutely biggest number on the machine.  
  1062. X * If your machine doesn't have HUGE, or float.h,
  1063. X * define VERYLARGE here. 
  1064. X *
  1065. X * example:
  1066. X#define VERYLARGE 1e38
  1067. X */
  1068. X
  1069. X#ifdef PC
  1070. X#include <float.h>
  1071. X#define VERYLARGE FLT_MAX
  1072. X#else
  1073. X#ifdef vms
  1074. X#include <float.h>
  1075. X#define VERYLARGE DBL_MAX
  1076. X#else
  1077. X#define VERYLARGE HUGE
  1078. X#endif
  1079. X#endif
  1080. X
  1081. X
  1082. X#define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
  1083. X
  1084. X
  1085. X
  1086. X
  1087. X#ifdef vms
  1088. X
  1089. X
  1090. X#define is_comment(c) ((c) == '#' || (c) == '!')
  1091. X#define is_system(c) ((c) == '$')
  1092. X
  1093. X
  1094. X#else /* vms */
  1095. X
  1096. X
  1097. X#define is_comment(c) ((c) == '#')
  1098. X#define is_system(c) ((c) == '!')
  1099. X
  1100. X
  1101. X#endif /* vms */
  1102. X
  1103. X
  1104. X/*
  1105. X * If you're memcpy() has another name, define it below as bcopy() is.
  1106. X * If you don't have a memcpy():
  1107. X#define NOCOPY
  1108. X */
  1109. X
  1110. X
  1111. X#ifdef BCOPY
  1112. X#define memcpy(dest,src,len) bcopy(src,dest,len)
  1113. X#endif /* BCOPY */
  1114. X
  1115. X
  1116. X#ifdef vms
  1117. X#define memcpy(dest,src,len) lib$movc3(&len,src,dest)
  1118. X#endif /* vms */
  1119. X
  1120. X
  1121. X/*
  1122. X * If you don't have BZERO, define it below.
  1123. X */
  1124. X#ifndef BZERO
  1125. X#define bzero(dest,len)  (void)(memset(dest, (char)NULL, len))
  1126. X#endif /* BZERO */
  1127. X
  1128. X
  1129. X#define top_of_stack stack[s_p]
  1130. X
  1131. X
  1132. Xtypedef int BOOLEAN;
  1133. X
  1134. X#ifdef __ZTC__
  1135. Xtypedef int (*FUNC_PTR)(...);
  1136. X#else
  1137. Xtypedef int (*FUNC_PTR)();
  1138. X#endif
  1139. X
  1140. X
  1141. Xenum operators {
  1142. X    PUSH, PUSHC, PUSHD, CALL, LNOT, BNOT, UMINUS, LOR, LAND, BOR, XOR,
  1143. X    BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT, DIV, MOD, POWER,
  1144. X    FACTORIAL, BOOL, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START
  1145. X};
  1146. X
  1147. X
  1148. X#define is_jump(operator) ((operator) >=(int)JUMP && (operator) <(int)SF_START)
  1149. X
  1150. X
  1151. Xenum DATA_TYPES {
  1152. X    INT, CMPLX
  1153. X};
  1154. X
  1155. X
  1156. Xenum PLOT_TYPE {
  1157. X    FUNC, DATA
  1158. X};
  1159. X
  1160. X
  1161. Xenum PLOT_STYLE {
  1162. X    LINES, POINTS, IMPULSES, LINESPOINTS, DOTS
  1163. X};
  1164. X
  1165. Xenum JUSTIFY {
  1166. X    LEFT, CENTRE, RIGHT
  1167. X};
  1168. X
  1169. Xstruct cmplx {
  1170. X    double real, imag;
  1171. X};
  1172. X
  1173. X
  1174. Xstruct value {
  1175. X    enum DATA_TYPES type;
  1176. X    union {
  1177. X        int int_val;
  1178. X        struct cmplx cmplx_val;
  1179. X    } v;
  1180. X};
  1181. X
  1182. X
  1183. Xstruct lexical_unit {    /* produced by scanner */
  1184. X    BOOLEAN is_token;    /* true if token, false if a value */ 
  1185. X    struct value l_val;
  1186. X    int start_index;    /* index of first char in token */
  1187. X    int length;            /* length of token in chars */
  1188. X};
  1189. X
  1190. X
  1191. Xstruct ft_entry {        /* standard/internal function table entry */
  1192. X    char *f_name;        /* pointer to name of this function */
  1193. X    FUNC_PTR func;        /* address of function to call */
  1194. X};
  1195. X
  1196. X
  1197. Xstruct udft_entry {                /* user-defined function table entry */
  1198. X    struct udft_entry *next_udf; /* pointer to next udf in linked list */
  1199. X    char udf_name[MAX_ID_LEN+1]; /* name of this function entry */
  1200. X    struct at_type *at;            /* pointer to action table to execute */
  1201. X    char *definition;             /* definition of function as typed */
  1202. X    struct value dummy_value;    /* current value of dummy variable */
  1203. X};
  1204. X
  1205. X
  1206. Xstruct udvt_entry {            /* user-defined value table entry */
  1207. X    struct udvt_entry *next_udv; /* pointer to next value in linked list */
  1208. X    char udv_name[MAX_ID_LEN+1]; /* name of this value entry */
  1209. X    BOOLEAN udv_undef;        /* true if not defined yet */
  1210. X    struct value udv_value;    /* value it has */
  1211. X};
  1212. X
  1213. X
  1214. Xunion argument {            /* p-code argument */
  1215. X    int j_arg;                /* offset for jump */
  1216. X    struct value v_arg;        /* constant value */
  1217. X    struct udvt_entry *udv_arg;    /* pointer to dummy variable */
  1218. X    struct udft_entry *udf_arg; /* pointer to udf to execute */
  1219. X};
  1220. X
  1221. X
  1222. Xstruct at_entry {            /* action table entry */
  1223. X    enum operators index;    /* index of p-code function */
  1224. X    union argument arg;
  1225. X};
  1226. X
  1227. X
  1228. Xstruct at_type {
  1229. X    int a_count;                /* count of entries in .actions[] */
  1230. X    struct at_entry actions[MAX_AT_LEN];
  1231. X        /* will usually be less than MAX_AT_LEN is malloc()'d copy */
  1232. X};
  1233. X
  1234. X
  1235. X/* Defines the type of a coordinate */
  1236. X/* INRANGE and OUTRANGE points have an x,y point associated with them */
  1237. Xenum coord_type {
  1238. X    INRANGE,                /* inside plot boundary */
  1239. X    OUTRANGE,                /* outside plot boundary, but defined */
  1240. X    UNDEFINED                /* not defined at all */
  1241. X};
  1242. X
  1243. Xstruct coordinate {
  1244. X    enum coord_type type;    /* see above */
  1245. X#ifdef PC
  1246. X    float x, y;            /* memory is tight on PCs! */
  1247. X#else
  1248. X    double x, y;
  1249. X#endif /* PC */
  1250. X};
  1251. X
  1252. X
  1253. Xstruct curve_points {
  1254. X    struct curve_points *next_cp;    /* pointer to next plot in linked list */
  1255. X    enum PLOT_TYPE plot_type;
  1256. X    enum PLOT_STYLE plot_style;
  1257. X    char *title;
  1258. X    int line_type;
  1259. X    int point_type;
  1260. X    int p_count;                    /* count of points in .points[] */
  1261. X    struct coordinate points[MAX_POINTS];
  1262. X        /* will usually be less in malloc()'d copy */
  1263. X};
  1264. X
  1265. X
  1266. Xstruct termentry {
  1267. X    char *name;
  1268. X    char *description;
  1269. X    unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
  1270. X    FUNC_PTR init,reset,text,scale,graphics,move,vector,linetype,
  1271. X        put_text,text_angle,justify_text,point,arrow;
  1272. X};
  1273. X
  1274. X
  1275. Xstruct text_label {
  1276. X    struct text_label *next;    /* pointer to next label in linked list */
  1277. X    int tag;                /* identifies the label */
  1278. X    double x,y;
  1279. X    enum JUSTIFY pos;
  1280. X    char text[MAX_LINE_LEN+1];
  1281. X};
  1282. X
  1283. Xstruct arrow_def {
  1284. X    struct arrow_def *next;    /* pointer to next arrow in linked list */
  1285. X    int tag;                /* identifies the arrow */
  1286. X    double sx,sy;            /* start position */
  1287. X    double ex,ey;            /* end position */
  1288. X};
  1289. X
  1290. X/* Tic-mark labelling definition; see set xtics */
  1291. Xstruct ticdef {
  1292. X    int type;                /* one of three values below */
  1293. X#define TIC_COMPUTED 1        /* default; gnuplot figures them */
  1294. X#define TIC_SERIES 2        /* user-defined series */
  1295. X#define TIC_USER 3            /* user-defined points */
  1296. X    union {
  1297. X       struct {            /* for TIC_SERIES */
  1298. X          double start, incr;
  1299. X          double end;        /* ymax, if VERYLARGE */
  1300. X       } series;
  1301. X       struct ticmark *user;    /* for TIC_USER */
  1302. X    } def;
  1303. X};
  1304. X
  1305. X/* Defines one ticmark for TIC_USER style.
  1306. X * If label==NULL, the value is printed with the usual format string.
  1307. X * else, it is used as the format string (note that it may be a constant
  1308. X * string, like "high" or "low").
  1309. X */
  1310. Xstruct ticmark {
  1311. X    double position;        /* where on axis is this */
  1312. X    char *label;            /* optional (format) string label */
  1313. X    struct ticmark *next;    /* linked list */
  1314. X};
  1315. X
  1316. X/*
  1317. X * SS$_NORMAL is "normal completion", STS$M_INHIB_MSG supresses
  1318. X
  1319. X * printing a status message.
  1320. X * SS$_ABORT is the general abort status code.
  1321. X from:    Martin Minow
  1322. X    decvax!minow
  1323. X */
  1324. X#ifdef    vms
  1325. X#include        <ssdef.h>
  1326. X#include        <stsdef.h>
  1327. X#define    IO_SUCCESS    (SS$_NORMAL | STS$M_INHIB_MSG)
  1328. X#define    IO_ERROR    SS$_ABORT
  1329. X#endif /* vms */
  1330. X
  1331. X
  1332. X#ifndef    IO_SUCCESS    /* DECUS or VMS C will have defined these already */
  1333. X#define    IO_SUCCESS    0
  1334. X#endif
  1335. X#ifndef    IO_ERROR
  1336. X#define    IO_ERROR    1
  1337. X#endif
  1338. X
  1339. X/* Some key global variables */
  1340. Xextern BOOLEAN screen_ok;
  1341. Xextern BOOLEAN term_init;
  1342. Xextern BOOLEAN undefined;
  1343. Xextern struct termentry term_tbl[];
  1344. X
  1345. Xextern char *alloc();
  1346. *-*-END-of-plot.h-*-*
  1347. echo x - help.h
  1348. sed 's/^X//' >help.h <<'*-*-END-of-help.h-*-*'
  1349. X/* Exit status returned by help() */
  1350. X#define    H_FOUND        0    /* found the keyword */
  1351. X#define    H_NOTFOUND    1    /* didn't find the keyword */
  1352. X#define    H_ERROR        (-1)    /* didn't find the help file */
  1353. X
  1354. Xextern void FreeHelp();        /* use this if you need memory */
  1355. *-*-END-of-help.h-*-*
  1356. echo x - setshow.h
  1357. sed 's/^X//' >setshow.h <<'*-*-END-of-setshow.h-*-*'
  1358. X/* GNUPLOT - setshow.h */
  1359. X/*
  1360. X * Copyright (C) 1986, 1987, 1990   Thomas Williams, Colin Kelley
  1361. X *
  1362. X * Permission to use, copy, and distribute this software and its
  1363. X * documentation for any purpose with or without fee is hereby granted, 
  1364. X * provided that the above copyright notice appear in all copies and 
  1365. X * that both that copyright notice and this permission notice appear 
  1366. X * in supporting documentation.
  1367. X *
  1368. X * Permission to modify the software is granted, but not the right to
  1369. X * distribute the modified code.  Modifications are to be distributed 
  1370. X * as patches to released version.
  1371. X *  
  1372. X * This software  is provided "as is" without express or implied warranty.
  1373. X * 
  1374. X *
  1375. X * AUTHORS
  1376. X * 
  1377. X *   Original Software:
  1378. X *     Thomas Williams,  Colin Kelley.
  1379. X * 
  1380. X *   Gnuplot 2.0 additions:
  1381. X *       Russell Lang, Dave Kotz, John Campbell.
  1382. X * 
  1383. X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1384. X * 
  1385. X */
  1386. X
  1387. X/*
  1388. X * global variables to hold status of 'set' options
  1389. X *
  1390. X */
  1391. Xextern BOOLEAN            autoscale_x;
  1392. Xextern BOOLEAN            autoscale_y;
  1393. Xextern BOOLEAN            autoscale_lx;
  1394. Xextern BOOLEAN            autoscale_ly;
  1395. Xextern BOOLEAN            clip_points;
  1396. Xextern BOOLEAN            clip_lines1;
  1397. Xextern BOOLEAN            clip_lines2;
  1398. Xextern char            dummy_var[];
  1399. Xextern char            xformat[];
  1400. Xextern char            yformat[];
  1401. Xextern enum PLOT_STYLE data_style, func_style;
  1402. Xextern BOOLEAN            grid;
  1403. Xextern int            key;
  1404. Xextern double            key_x, key_y; /* user specified position for key */
  1405. Xextern BOOLEAN            log_x, log_y;
  1406. Xextern FILE*            outfile;
  1407. Xextern char            outstr[];
  1408. Xextern BOOLEAN            polar;
  1409. Xextern int            samples;
  1410. Xextern float            xsize; /* scale factor for size */
  1411. Xextern float            ysize; /* scale factor for size */
  1412. Xextern int            term; /* unknown term is 0 */
  1413. Xextern char            title[];
  1414. Xextern char            xlabel[];
  1415. Xextern char            ylabel[];
  1416. Xextern double            xmin, xmax, ymin, ymax;
  1417. Xextern double            loff, roff, toff, boff;
  1418. Xextern double            zero; /* zero threshold, not 0! */
  1419. X
  1420. Xextern BOOLEAN xtics;
  1421. Xextern BOOLEAN ytics;
  1422. X
  1423. Xextern struct ticdef xticdef;
  1424. Xextern struct ticdef yticdef;
  1425. X
  1426. Xextern BOOLEAN            tic_in;
  1427. X
  1428. Xextern struct text_label *first_label;
  1429. Xextern struct arrow_def *first_arrow;
  1430. X
  1431. X/* The set and show commands, in setshow.c */
  1432. Xextern void set_command();
  1433. Xextern void show_command();
  1434. X/* and some accessible support functions */
  1435. Xextern enum PLOT_STYLE get_style();
  1436. Xextern BOOLEAN load_range();
  1437. Xextern void show_version();
  1438. *-*-END-of-setshow.h-*-*
  1439. echo x - lasergnu
  1440. sed 's/^X//' >lasergnu <<'*-*-END-of-lasergnu-*-*'
  1441. X#!/bin/csh -f
  1442. X#
  1443. X# Print gnuplot output on an Imagen or Postscript laser printer.
  1444. X
  1445. Xset print_banner = on    # Print a banner page unless told otherwise.
  1446. Xset input_files = ()    # the plot input command files
  1447. X
  1448. X# Default printer set by shell variable LASER.
  1449. Xif !($?LASER) then
  1450. X    set LASER = "imagen018"
  1451. Xendif
  1452. Xset printer = (-P$LASER)
  1453. X
  1454. X# File for plot commands, and for plot output
  1455. Xset TMP=/tmp/plot$$
  1456. Xset outfile=$TMP.out    # the output file
  1457. Xonintr cleanup
  1458. X
  1459. X# default is Imagen mode for Imagen printer; see -p option
  1460. Xset setterm="set terminal imagen"
  1461. Xset LANG="-Limpress"
  1462. X
  1463. Xset usage="usage: lasergnu [-Pprinter] [-b] [-p] [-t title] [-f file] ['plot command']...."
  1464. X
  1465. X# Loop through the command-line arguments.
  1466. X
  1467. Xtop:
  1468. X    if ($#argv > 0) then
  1469. X
  1470. X        switch ("$argv[1]")
  1471. X
  1472. X        case -b*:    # Do not print a banner page.
  1473. X        case -J*:    # Compatible with imprint.
  1474. X            set print_banner = off
  1475. X            shift argv
  1476. X            goto top
  1477. X
  1478. X        case -f?*:    # Specify file containing plot commands
  1479. X            set input_files = ($input_files `echo $argv[1] | sed 's/^-f//'`)
  1480. X            shift argv
  1481. X            goto top
  1482. X
  1483. X        case -f:    # Specify file containing plot commands
  1484. X            shift argv
  1485. X            if ($#argv > 0) then
  1486. X                set input_files = ($input_files $argv[1])
  1487. X                shift argv
  1488. X            else
  1489. X                echo "Usage: -f file ..."
  1490. X                echo "Type    lasergnu -help    for help."
  1491. X                exit (1)
  1492. X            endif
  1493. X            goto top
  1494. X
  1495. X        case -t?*:    # Specify title of plot
  1496. X            echo set title \""`echo $argv[1] | sed 's/^-t//'`"\" >> $TMP
  1497. X            shift argv
  1498. X            goto top
  1499. X
  1500. X        case -t:    # Specify title of plot
  1501. X            shift argv
  1502. X            if ($#argv > 0) then
  1503. X                echo set title \""$1"\" >> $TMP
  1504. X                shift argv
  1505. X            else
  1506. X                echo "Usage: -t title ..."
  1507. X                echo "Type    lasergnu -help    for help."
  1508. X                exit (1)
  1509. X            endif
  1510. X            goto top
  1511. X          case -help:
  1512. X            echo "$usage"
  1513. X            exit(1)
  1514. X
  1515. X        case -P?*:    # Set the printer, exactly as by itroff.
  1516. X            set printer = $argv[1]
  1517. X            shift argv
  1518. X            goto top
  1519. X
  1520. X        case -P:    # Set the printer, exactly as by itroff.
  1521. X            shift argv
  1522. X            if ($#argv > 0) then
  1523. X                set printer = (-P$argv[1])
  1524. X                shift argv
  1525. X            else
  1526. X                echo "Usage: -P printer ..."
  1527. X                echo "Type    lasergnu -help    for help."
  1528. X                exit (1)
  1529. X            endif
  1530. X            goto top
  1531. X
  1532. X                # use impress 
  1533. X           case -I:
  1534. X                echo Imagen is the default mode now
  1535. X             shift argv
  1536. X                goto top
  1537. X
  1538. X                # use postscript instead of impress language
  1539. X           case -p:
  1540. X                set setterm="set term postscript"
  1541. X                set LANG="-Lpostscript"
  1542. X             shift argv
  1543. X                goto top
  1544. X
  1545. X        case -?*:
  1546. X            echo "I do not recognize option $argv[1]."
  1547. X            echo "$usage"
  1548. X            exit (1)
  1549. X
  1550. X        default:
  1551. X              echo "$argv[1]"    >> $TMP
  1552. X            shift argv
  1553. X            goto top
  1554. X
  1555. X        endsw
  1556. X    endif
  1557. X
  1558. X# try to devine the printer type
  1559. Xif ($printer =~ -Plw*) then
  1560. X    set setterm="set term postscript"
  1561. X    set LANG="-Lpostscript"
  1562. Xendif
  1563. X
  1564. Xif ($printer =~ -Pim*) then
  1565. X    set setterm="set term imagen"
  1566. X    set LANG="-Limpress"
  1567. Xendif
  1568. X
  1569. X# Set up input file
  1570. Xecho $setterm > $TMP.plt
  1571. Xecho set output \"$outfile\" >> $TMP.plt
  1572. Xif (-e $TMP) cat $TMP >> $TMP.plt
  1573. X
  1574. X# If input file is specified AND command line contains plot commands, then
  1575. X#    do command line args first, then plot commands in input file.
  1576. Xgnuplot $TMP.plt $input_files
  1577. X
  1578. Xif ($status == 0 && -e $outfile && ! -z $outfile) then
  1579. X    # The printer is whatever printer was last specified,
  1580. X    # or the default printer if none was specified.
  1581. X    if ($LANG == -Limpress) then
  1582. X        /usr/local/bin/ipr $LANG $printer \
  1583. X           -D"jobheader $print_banner" \
  1584. X           -D"pagereversal on" \
  1585. X           -D"program lasergnu" $outfile
  1586. X    else if ($LANG == -Lpostscript) then
  1587. X        lpr $printer $outfile
  1588. X    endif
  1589. Xelse
  1590. X    echo "lasergnu: error in plotting or empty plot; nothing printed."
  1591. Xendif
  1592. X
  1593. Xcleanup:
  1594. Xrm -f $TMP* $outfile
  1595. *-*-END-of-lasergnu-*-*
  1596. echo x - demo/1.dat
  1597. sed 's/^X//' >demo/1.dat <<'*-*-END-of-demo/1.dat-*-*'
  1598. X-20.000000 -3.041676
  1599. X-19.000000 -3.036427
  1600. X-18.000000 -3.030596
  1601. X-17.000000 -3.024081
  1602. X-16.000000 -3.016755
  1603. X-15.000000 -3.008456
  1604. X-14.000000 -2.998978
  1605. X-13.000000 -2.988049
  1606. X-12.000000 -2.975310
  1607. X-11.000000 -2.960273
  1608. X-10.000000 -2.942255
  1609. X-9.000000 -2.920278
  1610. X-8.000000 -2.892883
  1611. X-7.000000 -2.857799
  1612. X-6.000000 -2.811295
  1613. X-5.000000 -2.746802
  1614. X-4.000000 -2.651635
  1615. X-3.000000 -2.498092
  1616. X-2.000000 -2.214297
  1617. X-1.000000 -1.570796
  1618. X0.000000 0.000000
  1619. X1.000000 1.570796
  1620. X2.000000 2.214297
  1621. X3.000000 2.498092
  1622. X4.000000 2.651635
  1623. X5.000000 2.746802
  1624. X6.000000 2.811295
  1625. X7.000000 2.857799
  1626. X8.000000 2.892883
  1627. X9.000000 2.920278
  1628. X10.000000 2.942255
  1629. X11.000000 2.960273
  1630. X12.000000 2.975310
  1631. X13.000000 2.988049
  1632. X14.000000 2.998978
  1633. X15.000000 3.008456
  1634. X16.000000 3.016755
  1635. X17.000000 3.024081
  1636. X18.000000 3.030596
  1637. X19.000000 3.036427
  1638. *-*-END-of-demo/1.dat-*-*
  1639. echo x - demo/2.dat
  1640. sed 's/^X//' >demo/2.dat <<'*-*-END-of-demo/2.dat-*-*'
  1641. X-20.000000 -6.083352
  1642. X-19.000000 -6.072853
  1643. X-18.000000 -6.061191
  1644. X-17.000000 -6.048162
  1645. X-16.000000 -6.033510
  1646. X-15.000000 -6.016913
  1647. X-14.000000 -5.997955
  1648. X-13.000000 -5.976098
  1649. X-12.000000 -5.950620
  1650. X-11.000000 -5.920546
  1651. X-10.000000 -5.884511
  1652. X-9.000000 -5.840556
  1653. X-8.000000 -5.785765
  1654. X-7.000000 -5.715597
  1655. X-6.000000 -5.622591
  1656. X-5.000000 -5.493603
  1657. X-4.000000 -5.303271
  1658. X-3.000000 -4.996183
  1659. X-2.000000 -4.428595
  1660. X-1.000000 -3.141593
  1661. X0.000000 0.000000
  1662. X1.000000 3.141593
  1663. X2.000000 4.428595
  1664. X3.000000 4.996183
  1665. X4.000000 5.303271
  1666. X5.000000 5.493603
  1667. X6.000000 5.622591
  1668. X7.000000 5.715597
  1669. X8.000000 5.785765
  1670. X9.000000 5.840556
  1671. X10.000000 5.884511
  1672. X11.000000 5.920546
  1673. X12.000000 5.950620
  1674. X13.000000 5.976098
  1675. X14.000000 5.997955
  1676. X15.000000 6.016913
  1677. X16.000000 6.033510
  1678. X17.000000 6.048162
  1679. X18.000000 6.061191
  1680. X19.000000 6.072853
  1681. *-*-END-of-demo/2.dat-*-*
  1682. echo x - demo/3.dat
  1683. sed 's/^X//' >demo/3.dat <<'*-*-END-of-demo/3.dat-*-*'
  1684. X-20.000000 -9.125028
  1685. X-19.000000 -9.109280
  1686. X-18.000000 -9.091787
  1687. X-17.000000 -9.072243
  1688. X-16.000000 -9.050265
  1689. X-15.000000 -9.025369
  1690. X-14.000000 -8.996933
  1691. X-13.000000 -8.964147
  1692. X-12.000000 -8.925931
  1693. X-11.000000 -8.880819
  1694. X-10.000000 -8.826766
  1695. X-9.000000 -8.760835
  1696. X-8.000000 -8.678648
  1697. X-7.000000 -8.573396
  1698. X-6.000000 -8.433886
  1699. X-5.000000 -8.240405
  1700. X-4.000000 -7.954906
  1701. X-3.000000 -7.494275
  1702. X-2.000000 -6.642892
  1703. X-1.000000 -4.712389
  1704. X0.000000 0.000000
  1705. X1.000000 4.712389
  1706. X2.000000 6.642892
  1707. X3.000000 7.494275
  1708. X4.000000 7.954906
  1709. X5.000000 8.240405
  1710. X6.000000 8.433886
  1711. X7.000000 8.573396
  1712. X8.000000 8.678648
  1713. X9.000000 8.760835
  1714. X10.000000 8.826766
  1715. X11.000000 8.880819
  1716. X12.000000 8.925931
  1717. X13.000000 8.964147
  1718. X14.000000 8.996933
  1719. X15.000000 9.025369
  1720. X16.000000 9.050265
  1721. X17.000000 9.072243
  1722. X18.000000 9.091787
  1723. X19.000000 9.109280
  1724. *-*-END-of-demo/3.dat-*-*
  1725. echo x - demo/controls.demo
  1726. sed 's/^X//' >demo/controls.demo <<'*-*-END-of-demo/controls.demo-*-*'
  1727. X#
  1728. X# warning:  this demo is SLOW on PCs without math coprocessors!
  1729. X#
  1730. X# From _Automatic_Control_Systems_, fourth ed., figure 6-14
  1731. X# transient response of a second-order system to a unit step input function
  1732. X#
  1733. Xdamp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
  1734. Xper(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
  1735. Xc(t) = 1-damp(t)*per(t)
  1736. X#
  1737. X#    wn is natural undamped frequency
  1738. X#    s is damping factor
  1739. X#
  1740. Xwn = 1.0
  1741. Xset xrange [0:13]
  1742. Xset samples 50
  1743. Xset dummy t
  1744. X#
  1745. X# plot c(t) for several different damping factors s
  1746. X#
  1747. Xplot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
  1748. Xpause -1 "Hit return to continue"
  1749. X
  1750. X# undo what we have done
  1751. Xset xrange [-10:10]
  1752. Xset autoscale xy
  1753. Xset samples 160
  1754. Xset dummy x
  1755. X
  1756. *-*-END-of-demo/controls.demo-*-*
  1757. echo x - demo/simple.demo
  1758. sed 's/^X//' >demo/simple.demo <<'*-*-END-of-demo/simple.demo-*-*'
  1759. X#
  1760. X# Requires data files "[123].dat" from this directory,
  1761. X# so change current working directory to this directory before running.
  1762. X# gnuplot> set term <term-type>
  1763. X# gnuplot> load 'simple.demo'
  1764. X#
  1765. Xset samples 50
  1766. Xplot [-10:10] sin(x),atan(x),cos(atan(x))
  1767. Xpause -1 "Hit return to continue"
  1768. X
  1769. Xset samples 100 
  1770. Xplot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1))
  1771. Xpause -1 "Hit return to continue"
  1772. X
  1773. Xset samples 200 
  1774. Xplot [-3:5] asin(x),acos(x)
  1775. Xpause -1 "Hit return to continue"
  1776. X
  1777. Xplot [-30:20] besj0(x)*0.12e1 with impulses, (x**besj0(x))-2.5 with points
  1778. Xpause -1 "Hit return to continue"
  1779. X
  1780. Xset samples 400
  1781. Xplot [-10:10] real(sin(x)**besj0(x))
  1782. Xpause -1 "Hit return to continue"
  1783. X
  1784. Xplot [-5*pi:5*pi] [-5:5] real(tan(x)/atan(x)), 1/x
  1785. Xpause -1 "Hit return to continue"
  1786. X
  1787. Xset autoscale
  1788. Xset samples 800
  1789. Xplot [-30:20] sin(x*20)*atan(x)
  1790. Xpause -1 "Hit return to continue"
  1791. X
  1792. Xplot [-19:19] '1.dat'with impulses ,'2.dat' ,'3.dat' with lines
  1793. Xpause -1 "Hit return to continue"
  1794. X
  1795. X# undo what we have done above
  1796. Xset samples 160
  1797. Xset xrange [-10:10]
  1798. Xset autoscale xy
  1799. *-*-END-of-demo/simple.demo-*-*
  1800. echo x - demo/polar.demo
  1801. sed 's/^X//' >demo/polar.demo <<'*-*-END-of-demo/polar.demo-*-*'
  1802. X#
  1803. X# Show some of the new polar capabilities.
  1804. X#
  1805. Xset polar
  1806. Xset dummy x
  1807. Xset samples 160
  1808. Xset xrange [0:2*pi]
  1809. Xset title "Three circles (with aspect ratio distortion)"
  1810. Xplot .5,1,1.5
  1811. Xpause -1 "Hit return"
  1812. Xset title ""
  1813. X
  1814. Xplot cos(2*x)
  1815. Xpause -1 "Hit return"
  1816. X
  1817. Xplot 2*sqrt(cos(x)),-2*sqrt(cos(x))
  1818. Xpause -1 "Hit return"
  1819. X
  1820. Xset offset pi/4,pi/4,0,0
  1821. Xplot sin(4*x),cos(4*x)
  1822. Xset offset 0,0,0,0
  1823. Xpause -1 "Hit return"
  1824. X
  1825. Xset yrange [-5:5]
  1826. Xplot x/cos(3*x)
  1827. Xpause -1 "Hit return"
  1828. Xset autoscale
  1829. X
  1830. Xplot 1-sin(x)
  1831. Xpause -1 "Hit return"
  1832. X
  1833. Xset xrange [0:12*pi]
  1834. Xplot 2*x
  1835. Xpause -1 "Hit return"
  1836. X
  1837. Xbutterfly(x)=exp(cos(x))-2*cos(4*x)+sin(x/12)**5
  1838. Xset samples 800
  1839. Xpause 0 "This is a big one (many samples), be patient..."
  1840. Xset title "Butterfly"
  1841. Xset nokey
  1842. Xplot butterfly(x)
  1843. Xpause -1 "Hit return"
  1844. X
  1845. X# undo what we've done above
  1846. Xset nopolar
  1847. Xset samples 160
  1848. Xset autoscale xy
  1849. Xset title ""
  1850. Xset offset 0,0,0,0
  1851. Xset key
  1852. *-*-END-of-demo/polar.demo-*-*
  1853. echo x - demo/electron.demo
  1854. sed 's/^X//' >demo/electron.demo <<'*-*-END-of-demo/electron.demo-*-*'
  1855. X# Electronics demo
  1856. X#
  1857. X# Bipolar Transistor (NPN) Mutual Characteristic
  1858. XIe(Vbe)=Ies*exp(Vbe/kT_q)
  1859. XIc(Vbe)=alpha*Ie(Vbe)+Ico
  1860. Xalpha = 0.99
  1861. XIes = 4e-14
  1862. XIco = 1e-09
  1863. XkT_q = 0.025
  1864. Xset dummy Vbe
  1865. Xset grid
  1866. Xset offsets
  1867. Xset nolog
  1868. Xset nopolar
  1869. Xset samples 160
  1870. Xset title "Mutual Characteristic of a Transistor"
  1871. Xset xlabel "Vbe (base emmitter voltage)"
  1872. Xset xrange [0 : 0.75]
  1873. Xset ylabel "Ic (collector current)"
  1874. Xset yrange [0 : 0.005]
  1875. Xset key .2,.0045
  1876. Xset format y "%.4f"
  1877. Xplot Ic(Vbe)
  1878. Xset format "%g"
  1879. X
  1880. Xpause -1 "Hit return to continue"
  1881. X
  1882. X# Junction Field Effect Transistor (JFET) Mutual Characteristic
  1883. X# drain current above pinch off
  1884. XIda(Vd)=Ido*(1-Vg/Vp)**2
  1885. X# drain current below pinch off
  1886. XIdb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
  1887. X# drain current
  1888. XId(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
  1889. X# drain current at zero gate voltage
  1890. XIdo = 2.5
  1891. X# pinch off voltage
  1892. XVp = -1.25
  1893. X# gate voltage
  1894. XVg = 0
  1895. Xset dummy Vd
  1896. Xset nogrid
  1897. Xset nokey
  1898. Xset offsets 0, 1, 0, 0
  1899. Xset title "JFET Mutual Characteristic"
  1900. Xset xlabel "Drain voltage Vd (V)"
  1901. Xset xrange [0 : 4]
  1902. Xset ylabel "Drain current Id (mA)"
  1903. Xset yrange [0 : 5]
  1904. Xset label "-0.5 Vp" at 4.1,0.625
  1905. Xset label "-0.25 Vp" at 4.1,1.4
  1906. Xset label "0" at 4.1,2.5
  1907. Xset label "Vg = 0.5 Vp" at 4.1,3.9
  1908. Xplot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
  1909. Xset nolabel
  1910. X
  1911. Xpause -1 "Hit return to continue"
  1912. X
  1913. X# amplitude frequency response
  1914. XA(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
  1915. Xp1 = 10
  1916. Xp2 = 10000
  1917. Xset dummy jw
  1918. Xset grid
  1919. Xset key
  1920. Xset logscale xy
  1921. Xset offsets 0, 0, 0, 0
  1922. Xset title "Amplitude Frequency Response"
  1923. Xset xlabel "jw (radians)"
  1924. Xset xrange [1.1 : 90000.0]
  1925. Xset ylabel "magnitude of A(jw)"
  1926. Xset autoscale  y
  1927. Xplot abs(A(jw))
  1928. X
  1929. Xpause -1 "Hit return"
  1930. X
  1931. X# phase frequency response
  1932. Xset nolog y
  1933. Xset logscale x
  1934. Xset title "Phase Frequency Response"
  1935. Xset ylabel "Phase of A(jw) (degrees)"
  1936. Xplot 180/pi*arg(A(jw))
  1937. X
  1938. Xpause -1 "Hit return"
  1939. X
  1940. X# undo what we've done
  1941. Xset dummy x
  1942. Xset nogrid
  1943. Xset offsets 0,0,0,0
  1944. Xset title ""
  1945. Xset ylabel ""
  1946. Xset xlabel ""
  1947. Xset xrange [-10:10]
  1948. Xset autoscale xy
  1949. Xset key
  1950. Xset format xy "%g"
  1951. Xset nolabel
  1952. Xset nolog
  1953. *-*-END-of-demo/electron.demo-*-*
  1954. echo x - bugtest/README
  1955. sed 's/^X//' >bugtest/README <<'*-*-END-of-bugtest/README-*-*'
  1956. XThese two programs demonstrate some of the bugs in the SunOS stdio
  1957. Xlibrary. The explanation, from `help bugs` in gnuplot:
  1958. X
  1959. X The most important known bug is actually in the stdio library for the
  1960. X Sun4 operating system (SunOS Sys4-3.2). The "%g" format for `printf`
  1961. X sometimes incorrectly prints numbers (e.g., 200000.0 as "2").  Thus,
  1962. X tic mark labels may be incorrect on a Sun4 version of gnuplot.  You
  1963. X may work around it by rescaling your data or by using the `set format`
  1964. X command to change the tic mark format to "%7.0f" or some other
  1965. X appropriate format. This appears to have been fixed in SunOS 4.0.
  1966. X
  1967. X Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
  1968. X and SunOS 4.0, the `sscanf` routine incorrectly parses "00 12" with
  1969. X the format "%f %f" and reads 0 and 0 instead of 0 and 12.  This
  1970. X affects data input. If your data file contains X coordinates that are
  1971. X zero but are specified like '00', '000', etc, then you will read the
  1972. X wrong Y values. Check your data files or do not use a Sun4 until they
  1973. X fix the bug. It does NOT appear that this has been fixed in SunOS
  1974. X 4.0, at least by 4.0.3.
  1975. X
  1976. X
  1977. Xcompile with
  1978. X  cc printf.c -o printf
  1979. X  cc scanf.c -o scanf
  1980. X
  1981. XDavid Kotz
  1982. XDecember 1989
  1983. X
  1984. X----------------
  1985. X
  1986. XThe program mscbug.c demonstrates a bug in Microsoft C 5.1.
  1987. X
  1988. XThe explanation, from `help bugs` in gnuplot:
  1989. X Microsoft C 5.1 has a nasty bug associated with the %g format for
  1990. X printf.  When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are
  1991. X used, printf will incorrectly print numbers in the range 1e-4 to 1e-1.  
  1992. X Numbers that should be printed in the %e format are incorrectly 
  1993. X printed in the %f format, with the wrong number of zeros after the 
  1994. X decimal point.
  1995. X To work around this problem, use the %e or %f formats explicitly.
  1996. X
  1997. Xcompile with
  1998. X  cl mscbug.c
  1999. X
  2000. XRussell Lang
  2001. XJanuary 1990
  2002. *-*-END-of-bugtest/README-*-*
  2003. echo x - bugtest/printf.c
  2004. sed 's/^X//' >bugtest/printf.c <<'*-*-END-of-bugtest/printf.c-*-*'
  2005. X#include <stdio.h>
  2006. X
  2007. Xmain()
  2008. X{
  2009. X    printf("%g %g %g %g %g %g %g\n",
  2010. X         2., 20., 200., 2000., 20000., 200000., 2000000.);
  2011. X}
  2012. *-*-END-of-bugtest/printf.c-*-*
  2013. echo x - bugtest/scanf.c
  2014. sed 's/^X//' >bugtest/scanf.c <<'*-*-END-of-bugtest/scanf.c-*-*'
  2015. X#include <stdio.h>
  2016. X
  2017. Xmain()
  2018. X{
  2019. X    float x,y;
  2020. X
  2021. X    sscanf("0 12", "%f %f\n", &x, &y);
  2022. X    printf("%f, %f  should be %f, %f\n", x, y, 0., 12.);
  2023. X
  2024. X    sscanf("00 12", "%f %f\n", &x, &y);
  2025. X    printf("%f, %f  should be %f, %f\n", x, y, 0., 12.);
  2026. X}
  2027. *-*-END-of-bugtest/scanf.c-*-*
  2028. echo x - bugtest/mscbug.c
  2029. sed 's/^X//' >bugtest/mscbug.c <<'*-*-END-of-bugtest/mscbug.c-*-*'
  2030. X#include <stdio.h>
  2031. X
  2032. Xmain()
  2033. X{
  2034. Xdouble x;
  2035. X
  2036. X    printf("look at the fourth, fifth and sixth columns\n");
  2037. X    printf("%%e\t\t %%f\t\t %%g\t %%.g\t %%.1g\t %%.2g\t %%.3g\n\n");
  2038. X    for ( x = 1e-6; x < 1e+4; x *= 10.0 )
  2039. X        printf("%e\t %f\t %g\t %.g\t %.1g\t %.2g\t %.3g\n",
  2040. X            x,x,x,x,x,x,x);
  2041. X}
  2042. *-*-END-of-bugtest/mscbug.c-*-*
  2043. echo x - term/README
  2044. sed 's/^X//' >term/README <<'*-*-END-of-term/README-*-*'
  2045. XDOCUMENTATION FOR GNUPLOT TERMINAL DRIVER WRITERS
  2046. XBy Russell Lang 1/90
  2047. X
  2048. XInformation on each terminal device driver is contained in term.c and
  2049. Xthe term/*.trm files.  Each driver is contained in a .trm file and is 
  2050. X#include'd into term.c.  Each driver has a set of initialisers in 
  2051. Xterm.c for term_tbl[], an array of struct termentry.
  2052. X
  2053. XHere is the definition of the struct termentry from plot.h:
  2054. X
  2055. Xstruct termentry {
  2056. X    char *name;
  2057. X    char *description;
  2058. X    unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
  2059. X    FUNC_PTR init,reset,text,scale,graphics,move,vector,linetype,
  2060. X        put_text,text_angle,justify_text,point,arrow;
  2061. X};
  2062. X
  2063. XHere's a brief description of each variable:
  2064. X
  2065. XThe char *name is a pointer to a string containing the name
  2066. Xof the terminal.  This name is used by the 'set terminal' and 
  2067. X'show terminal' commands.  
  2068. XThe name must be unique and must not be confused with an abbreviation 
  2069. Xof another name.  For example if the name "postscript" exists, it is not
  2070. Xpossible to have another name "postscript2".
  2071. XKeep the name under 15 characters.
  2072. X
  2073. XThe char *description is a pointer to a string containing a
  2074. Xdescription of the terminal, which is displayed in response
  2075. Xto the 'set terminal' command.  
  2076. XKeep the description under 60 characters.
  2077. X
  2078. Xxmax is the maximum number of points in the x direction.  
  2079. XThe range of points used by gnuplot is 0 to xmax-1.
  2080. X
  2081. Xymax is the maximum number of points in the y direction.  
  2082. XThe range of points used by gnuplot is 0 to ymax-1.
  2083. X
  2084. Xv_char is the height of characters, in the same units as xmax and ymax.
  2085. XThe border for labelling at the top and bottom of the plot is 
  2086. Xcalculated using v_char.  
  2087. Xv_char is used as the vertical line spacing for characters.
  2088. X
  2089. Xh_char is the width of characters, in the same units as xmax and ymax.
  2090. XThe border for labelling at the left and right of the plot is 
  2091. Xcalculated using h_char.  
  2092. XIf the _justify_text function returns FALSE, h_char is used to justify 
  2093. Xtext right or centre.  If characters are not fixed width, then the 
  2094. X_justify_text function must correctly justify the text.
  2095. X
  2096. Xv_tic is the vertical size of tics along the x axis, 
  2097. Xin the same units as ymax.
  2098. X
  2099. Xh_tic is the horizontal size of tics along the y axis, 
  2100. Xin the same units as xmax.
  2101. X
  2102. X
  2103. XHere's a brief description of what each term.c function does:
  2104. X
  2105. X_init()  Called once, when the device is first selected.  This procedure
  2106. Xshould set up things that only need to be set once, like handshaking and
  2107. Xcharacter sets etc...
  2108. X
  2109. X_reset()  Called when gnuplot is exited, the output device changed or
  2110. Xthe terminal type changed.  This procedure should reset the device, 
  2111. Xpossibly flushing a buffer somewhere or generating a form feed.
  2112. X
  2113. X_scale(xs,ys) Called just before _graphics(). This takes the x and y
  2114. Xscaling factors as information. If the terminal would like to do its
  2115. Xown scaling, it returns TRUE. Otherwise, it can ignore the information
  2116. Xand return FALSE: do_plot will do the scaling for you. null_scale is
  2117. Xprovided to do just this, so most drivers can ignore this function
  2118. Xentirely. The Latex driver is currently the only one providing its own
  2119. Xscaling.
  2120. X
  2121. X_graphics()  Called just before a plot is going to be displayed.  This
  2122. Xprocedure should set the device into graphics mode.  Devices which can't
  2123. Xbe used as terminals (like plotters) will probably be in graphics mode 
  2124. Xalways and therefore won't need this.
  2125. X
  2126. X_text()  Called immediately after a plot is displayed.  This procedure 
  2127. Xshould set the device back into text mode if it is also a terminal, so
  2128. Xthat commands can be seen as they're typed.  Again, this will probably
  2129. Xdo nothing if the device can't be used as a terminal.
  2130. X
  2131. X_move(x,y)  Called at the start of a line.  The cursor should move to the
  2132. X(x,y) position without drawing.
  2133. X
  2134. X_vector(x,y)  Called when a line is to be drawn.  This should display a line
  2135. Xfrom the last (x,y) position given by _move() or _vector() to this new (x,y)
  2136. Xposition.
  2137. X
  2138. X_linetype(lt)  Called to set the line type before text is displayed or
  2139. Xline(s) plotted.  This procedure should select a pen color or line
  2140. Xstyle if the device has these capabilities.  
  2141. Xlt is an integer from -2 to 0 or greater.  
  2142. XAn lt of -2 is used for the border of the plot.
  2143. XAn lt of -1 is used for the X and Y axes.  
  2144. Xlt 0 and upwards are used for plots 0 and upwards.
  2145. XIf _linetype() is called with lt greater than the available line types, 
  2146. Xit should map it to one of the available line types.
  2147. XMost drivers provide 9 different linetypes (lt is 0 to 8).
  2148. X
  2149. X_put_text(x,y,str)  Called to display text at the (x,y) position, 
  2150. Xwhile in graphics mode.   The text should be vertically (with respect 
  2151. Xto the text) justified about (x,y).  The text is rotated according 
  2152. Xto _text_angle and then horizontally (with respect to the text)
  2153. Xjustified according to _justify_text.
  2154. X
  2155. X_text_angle(ang)  Called to rotate the text angle when placing the y label.
  2156. XIf ang = 0 then text is horizontal.  If ang = 1 then text is vertically
  2157. Xupwards.  Returns TRUE if text can be rotated, FALSE otherwise.
  2158. X
  2159. X_justify_text(mode)  Called to justify text left, right or centre.
  2160. XIf mode = LEFT then text placed by _put_text is flushed left against (x,y).
  2161. XIf mode = CENTRE then centre of text is at (x,y).  
  2162. XIf mode = RIGHT then text is placed flushed right against (x,y).
  2163. XReturns TRUE if text can be justified
  2164. XReturns FALSE otherwise and then _put_text assumes text is flushed left;
  2165. Xjustification of text is then performed by calculating the text width
  2166. Xusing strlen(text) * h_char.
  2167. X
  2168. X_point(x,y,point)  Called to place a point at position (x,y).
  2169. Xpoint is -1 or an integer from 0 upwards.  
  2170. X6 point types (numbered 0 to 5) are normally provided.  
  2171. XPoint type -1 is a dot.
  2172. XIf point is more than the available point types then it should 
  2173. Xbe mapped back to one of the available points.
  2174. XTwo _point() functions called do_point() and line_and_point() are 
  2175. Xprovided in term.c and should be suitable for most drivers.  
  2176. Xdo_point() draws the points in the current line type.
  2177. XIf your driver uses dotted line types (generally because it is
  2178. Xmonochrome), you should use line_and_point() which changes to 
  2179. Xline type 0 before drawing the point.  line type 0 should be solid.
  2180. X
  2181. X
  2182. X_arrow(sx,sy,ex,ey)  Called to draw an arrrow from (sx,sy) to (ex,ey).
  2183. XAn _arrow() function called do_arrow() is provided in term.c which will
  2184. Xdraw arrows using the _move() and _vector() functions.  
  2185. XDrivers should use do_arrow unless it causes problems.
  2186. X
  2187. X
  2188. XThe following should illustrate the order in which calls to these
  2189. Xroutines are made:
  2190. X
  2191. X  _init()
  2192. X    _scale(xs,ys)
  2193. X    _graphics()
  2194. X      _linetype(lt)
  2195. X      _move(x,y)
  2196. X      _vector(x,y)
  2197. X      _point(x,y,point)
  2198. X      _text_angle(angle)
  2199. X      _justify(mode)
  2200. X      _put_text(x,y,text)
  2201. X      _arrow(sx,sy,ex,ey)
  2202. X    _text()
  2203. X    _graphics()
  2204. X      .
  2205. X      .
  2206. X    _text()
  2207. X  _reset()
  2208. X
  2209. X
  2210. *-*-END-of-term/README-*-*
  2211. echo x - linkopt.vms
  2212. sed 's/^X//' >linkopt.vms <<'*-*-END-of-linkopt.vms-*-*'
  2213. Xsys$library:vaxcrtl/share
  2214. *-*-END-of-linkopt.vms-*-*
  2215. echo x - buildvms.com
  2216. sed 's/^X//' >buildvms.com <<'*-*-END-of-buildvms.com-*-*'
  2217. X$ ! buildvms.com  (Command file to compile/link gnuplot and doc2hlp)
  2218. X$ CFLAGS = "/NOOP"
  2219. X$ TERMFLAGS = "/define=(AED,BITGRAPH,DXY800A,HP2648,HP26,HP75,HPGL,KERMIT,LATEX,POSTSCRIPT,QMS,REGIS,SELANAR,TEK,V384)"
  2220. X$ set verify
  2221. X$ cc 'CFLAGS' command.c
  2222. X$ cc 'CFLAGS' eval.c
  2223. X$ cc 'CFLAGS' graphics.c
  2224. X$ cc 'CFLAGS' internal.c
  2225. X$ cc 'CFLAGS' misc.c
  2226. X$ cc 'CFLAGS' parse.c
  2227. X$ cc 'CFLAGS' plot.c
  2228. X$ cc 'CFLAGS' scanner.c
  2229. X$ cc 'CFLAGS' setshow.c
  2230. X$ cc 'CFLAGS' standard.c
  2231. X$ cc 'CFLAGS' 'TERMFLAGS' term.c
  2232. X$ cc 'CFLAGS' util.c
  2233. X$ cc 'CFLAGS' version.c
  2234. X$ link /exe=gnuplot -
  2235. X   command.obj,eval.obj,graphics.obj,internal.obj, -
  2236. X   misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
  2237. X   standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
  2238. X$ cc [.docs]doc2hlp.c
  2239. X$ link doc2hlp,linkopt.vms/opt
  2240. X$ @[.docs]doc2hlp.com
  2241. X$ library/create/help gnuplot.hlb gnuplot.hlp
  2242. X$ set noverify
  2243. X
  2244. *-*-END-of-buildvms.com-*-*
  2245. exit
  2246.  
  2247.  
  2248.