home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-25 | 68.7 KB | 2,248 lines |
- Newsgroups: comp.sources.misc
- organization: Pixar -- Marin County, California
- subject: v11i066: Gnuplot 2.0 - 1 of 14
- From: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 11, Issue 66
- Submitted-by: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Archive-name: gnuplot2/part01
-
- This is gnuplot.sh01
-
- --- CUT HERE ---
- #! /bin/sh
- echo x - Copyright
- sed 's/^X//' >Copyright <<'*-*-END-of-Copyright-*-*'
- X/*
- X * Copyright (C) 1986, 1987, 1990 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
- X *
- X */
- *-*-END-of-Copyright-*-*
- echo x - README
- sed 's/^X//' >README <<'*-*-END-of-README-*-*'
- XThe GNUPLOT source code and executables may be copied and/or modified
- Xfreely as long as the copyright messages are left intact.
- X
- XCompilation instructions are near the end of this file.
- X
- XGNUPLOT has been tested on Sun3's and Sun4's (SunOS 4.0.3), a Pyramid
- X90x (OSx 4.0 - ucb 4.3 and att V), a VAX 6410 (VMS 5.2), IBM PC XT's
- Xand AT's (MS-DOS 3.3, Microsoft C 5.10 and Turbo C 2.0)), IRIS 4D/70G
- Xand 4D/25G with MIPS C, and NeXT with gnu C 1.34. The code is written
- Xwith portability in mind.
- X
- XIf you have problems, send mail to pixar!info-gnuplot@sun.com. And
- Xplease send any modifications you make so they can be considered for
- Xlater releases.
- X
- X
- X GNUPLOT 2.0 RELEASE NOTES
- X
- XNew terminal drivers: Roland DXY800A, EEPIC, EPSON LX-800, Fig,
- XHP2648, HPGL, HP LaserJet, Imagen, Kermit-MS Tektronix emulator,
- XLaTeX, MCGA, NEC CP6 pinwriter, POSTSCRIPT, Proprinter, SUN, VGA.
- X
- XAdditions:
- X
- XCommand-line arguments are accepted. They are treated as names of
- Xfiles containing gnuplot commands. Gnuplot loads them, one by one, and
- Xthen exits.
- X
- XCommand 'plot' now has a 'title' option to change the information in
- Xthe key. The 'with' option can now specify line type and point type.
- X
- XCommand 'pause'.
- X
- XCommand 'replot' allows the addition of extra plots.
- X
- XCommand 'save' now saves all the 'set' options, including the last
- Xplot command.
- X
- XCommand 'set autoscale' now accepts autoscaling on the x axis for data
- Xfiles. The default is autoscaling on both axes.
- X
- XCommand 'set noclip' disables clipping of points near the border. 'set
- Xclip' reenables clipping. The default used to be 'clip', and is now
- X'noclip'. Clipping has also been extended to clip lines that extend
- Xoutside the borders: line plots are now clipped at the plot boundary.
- XFormerly, the line stopped at the last in-range data point.
- X
- XNumerical labelling at tic marks on x and y axes. Command 'set
- Xformat' allows the format of the tic mark labels to be altered.
- XCommands 'set xtics' and 'set ytics' allow for alphanumeric labels and
- Xarbitrary tic positions.
- X
- XCommand 'set grid' adds a grid between the tic marks.
- X
- XImproved key gives sample point or line types. Key can be disabled
- Xwith the 'set nokey'. Key can be positioned anywhere.
- X
- XCommand 'set label' allows the placement of arbitrary text labels and
- Xarrows.
- X
- XCommand 'set polar' for polar plots.
- X
- XCommand 'set offsets' for reducing the plotted area. Useful for polar
- Xplots.
- X
- XCommand 'set size' scales the displayed size of the plot.
- X
- XCommand 'set tics out' causes the tics to be drawn outwards from the
- Xborder. Useful for impulse plots.
- X
- XCommand 'set title' places a text label above the plot.
- X
- XCommands 'set xlabel' and 'set ylabel' place text labels on the x and
- Xy axes respectively. Some terminals will place the y label vertically
- Xupwards on the left of the plot, others place the label horizontally
- Xat the left of the plot.
- X
- XImproved tics on log scales.
- X
- XExtended comments: comments are allowed anywhere reasonable in the
- Xinput line, and continue to the end of the input line.
- X
- XLine continuation (with \) is added.
- X
- XNon-interactive use, through redirection or "load" command, is
- Ximproved. Error messages expanded to include file name and line
- Xnumber, and to reprint command line if not interactive.
- X
- XNew plotting styles 'linespoints' and 'dots'.
- X
- XBlank lines in data files denote "breaks". In lines and linespoints
- Xplot styles, this breaks the curve being drawn and begins at the next
- Xpoint, without changing the line or point types.
- X
- XCompletely new interactive help system that is similar to VMS help
- Xsystem. A printed manual can be obtained in LaTeX, troff, or nroff and
- Xis based on the same information as the interactive help.
- X
- XPC version now compiles with the large model so that gnuplot will
- Xcompile with the above additions!
- X
- XBug fixes include:
- X------------------
- XBug involving functions plotted on a logarithmic x axis is fixed.
- X
- XErrors inside of loaded files now clean up and close files properly.
- X
- XNumbers of the form xxxxe+nn are now acceptable (+ sign caused error).
- X
- XTics are now place inside the borders (some were outside).
- X
- XReverse axes now work properly.
- X
- XCommand 'set output ""' used to crash.
- X
- XVMS was closing stdout, so 'set output' code changed to avoid closing
- Xit. VMS version of gnuplot now performs a SET TERM/NOWRAP itself.
- X
- XTerminal is now reset before closing output file, changing terminal
- Xtype or exiting gnuplot.
- X
- XSeveral old bugs have been superseded by new ones.
- X
- X
- X ACKNOWLEDGEMENTS
- X
- XThe Unix PC, polar, pause, and offset additions were by John Campbell.
- X(CAMPBELL@NAUVAX.bitnet)
- XThe Turbo C additions were by Bill Wilson.
- X(WILSON@NAUVAX.bitnet)
- XSome of the labelling improvements and combining of these additions
- Xwere by Russell Lang.
- X(rjl@monu1.cc.monash.oz.au)
- XThe LaTeX driver, the help system, and some of the labelling
- Ximprovements were by David Kotz.
- X(dfk@cs.duke.edu)
- XAnd of course, the vast majority of the program is by Colin Kelley
- Xand Thomas Williams.
- X(pixar!info-gnuplot@sun.com)
- X
- X
- X GNUPLOT 1.1 RELEASE NOTES
- X
- XNew terminal drivers: AED 512, BBN BitGraph, HP2623, POSTSCRIPT,
- XSelanar, Vectrix 384. The PC version now supports Hercules and ATT
- X6300 monochrome graphics. Thanks to those who sent these drivers in.
- X
- XNew commands: 'set dummy' and 'show dummy' to select the dummy
- Xvariable name; 'replot' to repeat the last 'plot' command.
- X
- XThe exclamation point (!) is now accepted as postfix factorial
- Xoperator. The gamma() function is also included, if your C library
- Xhas gamma(). See GAMMA below.
- X
- XLogical AND (&&) and OR (||) now short-circuit the way they do in C.
- XThat is, the second && operand is not evaluated if the first is false;
- Xthe second || operand is not evaluated if the first is true. The
- Xternary operator (?:) also does not evaluate the unused operand. This
- Xchange allows for the definition of recursive functions, e.g. a
- Xsynonym for the ! factorial operator:
- X
- X fact(x) = (x<=1) ? 1 : x*fact(x-1)
- X
- XGNUPLOT now has a much better memory allocation scheme, replacing most
- Xfixed-size arrays with malloc()'d linked lists. There is no longer
- Xany artificial maximum on the number of simultaneous plots, number of
- Xpoints in those plots, or the number of user-defined functions or
- Xvariables. All these are limited only by the memory available to
- Xmalloc(). This is a big improvement for memory-starved machines like
- XPDP-11s or PCs.
- X
- XLines beginning with # (also ! in VMS) are treated as comments. Only
- Xthe $ may now be used for a shell escape in VMS, since ! is a comment.
- X
- XSeveral old bugs have been superseded by new ones.
- X
- X
- X PREPROCESSOR #DEFINES
- X
- XThese #defines should be checked before compilation:
- Xdefine file note
- X------ ---- --------
- XVFORK Makefile define if you've got vfork() system call
- XGAMMA Makefile define if you've got gamma(3)
- XBCOPY Makefile define if your memcpy() is called bcopy()
- XBZERO Makefile define if you have bzero() but not memset()
- XNOCOPY Makefile define if you've don't have a memcpy() by any name
- Xbcopy() plot.h define if you've got a memcpy() by some OTHER name
- X (see example in plot.h)
- XPC Makefile define if compiling on a PClone
- XMSDOS Makefile define if compiling under MSDOS;
- X automatically defined by Microsoft C 5.10
- XHELPFILE Makefile name including path of gnuplot.gih file.
- XVERYLARGE plot.h define to be largest coordinate number.
- XSHELL plot.h default shell to spawn if SHELL environment
- X variable not found at run-time
- X
- XValid TERMFLAGS defines. These defines are used to include the
- Xvarious plotting terminals, printers, and protocols that a given version
- Xof gnuplot can access:
- X
- Xdefine file note
- X------ ---- --------
- XTERMFLAGS Makefile the set of terminals you want, from below
- X
- X AED AED 512 and AED 767
- X BITGRAPH BBN BitGraph
- X DXY800A Roland DXY800A plotter
- X EPSON Epson LX-800, Star NL-10, NX-1000 and lots of others
- X FIG Fig graphics language (requires object.h from TransFig)
- X HP2648 HP2648, HP2647
- X HP26 HP2623A and maybe others
- X HP75 HP7580, and probably other HPs
- X HPGL HP7475 and (hopefully) lots of others
- X HPLJET HP Laserjet
- X IMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
- X IRIS4D IRIS4D series computer
- X KERMIT MS-Kermit Tektronix 4010 emulator
- X LATEX LATEX picture environment
- X NEC NEC CP6 pinwriter printer
- X POSTSCRIPT Postscript
- X PROPRINTER IBM Proprinter
- X QMS QMS/QUIC laserprinter (Talaris 1200 and others)
- X REGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
- X SELANAR Selanar
- X TEK Tektronix 4010, and probably others
- X SUN Sun Microsystems Workstation
- X UNIXPC unixpc (ATT 3b1 or ATT 7300)
- X UNIXPLOT unixplot
- X V384 Vectrix 384 and tandy color printer
- X
- X
- XThese #defines are defined automatically by various compilers, some
- Xgnuplot routines check these defines to implement features found in the
- Xvarious environments:
- X
- Xdefine note
- X------ --------
- Xvms (and VMS) defined by VAX-11 C under VMS.
- X
- X__TURBOC__ defined automatically by Turbo C 2.0
- X__ZTC__ defined automatically by Zortech C
- X
- X
- X TO COMPILE
- X
- Xunder UNIX:
- XTo compile do:
- X cp makefile.unx Makefile
- X (make any changes to #defines, especially HELPDEST and TERMFLAGS)
- X make
- X
- Xunder VMS:
- X To compile:
- X copy makefile.vms makefile.
- X make
- X Or if you don't have a suitable make:
- X @buildvms
- X To tell gnuplot where to find the help library:
- X $ define gnuplot$help disk:[directory]gnuplot.hlb
- X Alternatively (and preferably) put the help in the main system help library.
- X
- Xunder MSDOS:
- XUsing Microsoft C 5.10.
- X make makefile.msc
- X
- XUsing Turbo C 2.0.
- X make -fmakefile.tc
- X
- XThe file gnuplot.gih is needed for help on the PC.
- XIf the file gnuplot.gih is not in the default directory, then use:
- X set GNUHELP={full path name of gnuplot.gih}
- X
- XThe Zortech C++ compiler has been used to compile gnuplot, but
- Xit has not been tested. The Microsoft MASM and linker are needed.
- X
- X
- X ENVIRONMENT VARIABLES
- X
- XIf the environment variable GNUTERM is found, it is used as the terminal
- Xtype. Otherwise, in some cases the variable TERM will be used, or the
- Xhardware may be automatically detected.
- X
- XThe PC version looks for the environment variable GNUPLOT to contain
- Xthe name of the directory from which to load the initialization file
- XGNUPLOT.INI. See the help on 'start_up' for more information.
- X
- XHOME is examined as a directory where a .gnuplot startup file might be
- Xfound. See help on "start-up".
- X
- XIf defined, the environment variable GNUHELP is used for the name
- Xof the .gih help file, otherwise HELPFILE (defined in makefile or
- Xplot.c) is used.
- X
- XThe VMS version looks for the logical name GNUPLOT$HELP to locate
- Xthe help library.
- *-*-END-of-README-*-*
- echo x - README.gnutex
- sed 's/^X//' >README.gnutex <<'*-*-END-of-README.gnutex-*-*'
- XA note to former Gnutex users, from David Kotz (dfk@cs.duke.edu).
- X-----------------------------------------------------------------
- X
- XMarch 4, 1990
- X
- XI am happy to be a part of GNUPLOT 2.0, and I believe that it is a
- Xmuch improved program from its various predecessors. Many aspects of
- Xgnutex 1.6 made it into GNUPLOT 2.0. Unfortunately for those of us who
- Xhave a lot of gnutex input files around, not everything from gnutex is
- Xsupported by GNUPLOT. To help gnutex users with the process of
- Xadapting to GNUPLOT (and I recommend it), I have included a section in
- Xthe LaTeX/GNUPLOT tutorial (in ./docs/latextut/) about the
- Xdifferences, and written a translator program (in ./translate/).
- XPlease read the LaTeX/GNUPLOT tutorial.
- X
- XUsers of gnutex that did not use the LaTeX driver will probably have
- Xlittle difficulty adapting.
- X
- XPlease send all comments, complaints, and suggestions on this subject
- Xto dfk@cs.duke.edu.
- *-*-END-of-README.gnutex-*-*
- echo x - makefile.unx
- sed 's/^X//' >makefile.unx <<'*-*-END-of-makefile.unx-*-*'
- X#
- X# GNUPLOT Makefile
- X#
- X
- X# directory where to install executables on 'make install'
- XDEST=/usr/local/bin
- X# directory for installing man page on 'make man_install'
- XMANDEST=/usr/man/manl
- X# where to install help file gnuplot.gih
- X#HELPDEST=/usr/local/lib/gnuplot.gih
- XHELPDEST=docs/gnuplot.gih
- X# Where to send email about bugs and comments (locally)
- XEMAIL=\"pixar\!bug-gnuplot@sun.com\"
- X
- X# -DVFORK if you have vfork()
- X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
- X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
- X# -DNOCOPY if you don't have a memcpy() by any name
- X# -DGAMMA if you've got gamma(3)
- X# -fswitch if you are compiling on a Sun3 (or even -f68881)
- X# -O if you trust your compiler's optimizer
- XCFLAGS = -DVFORK -DBCOPY -DBZERO -DGAMMA #-gx #-O
- X
- X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
- X# -DAED AED 512 and AED 767
- X# -DBITGRAPH BBN BitGraph
- X# -DDXY800A Roland DXY800A plotter
- X# -DEEPIC EEPIC-extended LaTeX driver, for EEPIC users
- X# -DEPSON Epson LX-800, Star NL-10, NX-1000 and lots of others
- X# -DFIG Fig graphics language (requires object.h from TransFig)
- X# -DHP2648 HP2648, HP2647
- X# -DHP26 HP2623A and maybe others
- X# -DHP75 HP7580, and probably other HPs
- X# -DHPGL HP7475, HP7220 plotters, and (hopefully) lots of others
- X# -DHPLJET HP Laserjet
- X# -DIMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
- X# -DIRIS4D IRIS4D series computer
- X# -DKERMIT MS-Kermit Tektronix 4010 emulator
- X# -DLATEX LATEX picture environment
- X# -DNEC NEC CP6 pinwriter printer
- X# -DPOSTSCRIPT Postscript
- X# -DPROPRINTER IBM Proprinter
- X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
- X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
- X# -DSELANAR Selanar
- X# -DTEK Tektronix 4010, and probably others
- X# -DSUN Sun Microsystems Workstation
- X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
- X# -DUNIXPLOT unixplot
- X# -DV384 Vectrix 384 and tandy color printer
- X
- XTERMFLAGS = -Iterm -DAED -DBITGRAPH -DDXY800A -DEPSON -DHP2648 \
- X -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX -DEEPIC \
- X -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
- X -DUNIXPLOT -DV384
- X
- XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
- X plot.o scanner.o setshow.o standard.o term.o util.o
- X
- XDIRS = term demo bugtest docs docs/latextut translate
- XCSOURCE1 = command.c setshow.c
- XCSOURCE2 = help.c graphics.c internal.c
- XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
- XCSOURCE4 = term.c util.c version.c
- XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
- X term/hp26.trm term/hp2648.trm term/hpgl.trm \
- X term/hpljet.trm term/iris4d.trm term/sun.trm
- XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
- X term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm
- XCSOURCE7 = term/imPcodes.h term/imagen.trm term/object.h term/fig.trm \
- X term/latex.trm term/eepic.trm
- X# not C code, but still needed
- XETC = Copyright README README.gnutex makefile.unx makefile.vms \
- X makefile.3b1 makefile.ult plot.h help.h setshow.h lasergnu \
- X demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
- X demo/simple.demo demo/polar.demo demo/electron.demo \
- X bugtest/README bugtest/printf.c bugtest/scanf.c \
- X bugtest/mscbug.c term/README \
- X linkopt.vms buildvms.com
- X# PC-specific files
- XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
- X linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm
- X# Documentation and help files
- XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
- X docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
- X docs/gnuplot.1 docs/lasergnu.1 \
- X docs/titlepage.ms docs/titlepage.tex
- XDOCS2 = docs/gnuplot.doc
- XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
- X docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
- X docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
- X docs/latextut/header.tex docs/latextut/tutorial.tex
- X# gnutex->gnuplot translator
- XTSOURCE1 = translate/Makefile translate/README translate/command.c \
- X translate/eval.c translate/gnut2p.1 translate/internal.c \
- X translate/misc.c translate/parse.c translate/plot.c
- XTSOURCE2 = \
- X translate/plot.h translate/scanner.c translate/standard.c \
- X translate/test1 translate/test2 translate/util.c
- X
- X# -lplot if you have -DUNIXPLOT
- X# -lsuntool -lsunwindow -lpixrect if you have -DSUN
- X# -lgl_s if IRIS4D
- XLIBS = -lm -lplot
- X
- Xgnuplot: $(OBJS) version.o
- X cc $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot
- X
- Xdoc:
- X ( cd docs; make gnuplot.gih )
- X
- Xtranslate:
- X (cd translate; make)
- X
- Xall: gnuplot doc
- X
- Xinstall: gnuplot doc man_install
- X cp gnuplot lasergnu $(DEST)
- X strip $(DEST)/gnuplot
- X (cd docs; make install-unix HELPDEST=$(HELPDEST))
- X
- Xman_install: docs/gnuplot.1 docs/lasergnu.1
- X cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
- X
- Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
- X cc $(CFLAGS) $(TERMFLAGS) -c term.c
- X
- Xversion.o:
- X cc $(CFLAGS) -DCONTACT=$(EMAIL) -c version.c
- X
- X$(OBJS): plot.h
- X
- Xcommand.o:
- X cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
- X
- Xcommand.o help.o misc.o: help.h
- X
- Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
- X
- XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
- X $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
- X
- Xlint:
- X lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
- X
- Xclean:
- X rm -f *.o *~ term/*~
- X (cd docs; make clean)
- X (cd docs/latextut; make clean)
- X (cd translate; make clean)
- X
- Xspotless:
- X rm -f *.o *~ term/*~ TAGS gnuplot
- X (cd docs; make clean)
- X (cd docs/latextut; make spotless)
- X (cd translate; make spotless)
- X
- Xshar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
- X gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
- X gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
- X gnuplot.sh13 gnuplot.sh14
- X
- Xgnuplot.sh00:
- X echo '#!/bin/sh' > gnuplot.sh00
- X echo '# This is a shell file to make directories' >> gnuplot.sh00
- X echo mkdir $(DIRS) >> gnuplot.sh00
- X
- Xgnuplot.sh01: $(ETC)
- X shar $(ETC) > gnuplot.sh01
- X
- Xgnuplot.sh02: $(DOCS1)
- X shar $(DOCS1) > gnuplot.sh02
- X
- Xgnuplot.sh03: $(DOCS2)
- X shar $(DOCS2) > gnuplot.sh03
- X
- Xgnuplot.sh04: $(DOCS3)
- X shar $(DOCS3) > gnuplot.sh04
- X
- Xgnuplot.sh05: $(CSOURCE1)
- X shar $(CSOURCE1) > gnuplot.sh05
- X
- Xgnuplot.sh06: $(CSOURCE2)
- X shar $(CSOURCE2) > gnuplot.sh06
- X
- Xgnuplot.sh07: $(CSOURCE3)
- X shar $(CSOURCE3) > gnuplot.sh07
- X
- Xgnuplot.sh08: $(CSOURCE4)
- X shar $(CSOURCE4) > gnuplot.sh08
- X
- Xgnuplot.sh09: $(CSOURCE5)
- X shar $(CSOURCE5) > gnuplot.sh09
- X
- Xgnuplot.sh10: $(CSOURCE6)
- X shar $(CSOURCE6) > gnuplot.sh10
- X
- Xgnuplot.sh11: $(CSOURCE7)
- X shar $(CSOURCE7) > gnuplot.sh11
- X
- Xgnuplot.sh12: $(PC)
- X shar $(PC) > gnuplot.sh12
- X
- Xgnuplot.sh13: $(TSOURCE1)
- X shar $(TSOURCE1) > gnuplot.sh13
- X
- Xgnuplot.sh14: $(TSOURCE2)
- X shar $(TSOURCE2) > gnuplot.sh14
- X
- *-*-END-of-makefile.unx-*-*
- echo x - makefile.vms
- sed 's/^X//' >makefile.vms <<'*-*-END-of-makefile.vms-*-*'
- X#
- X# GNUPLOT Makefile
- X# for VMS
- X#
- X# use with the MAKE that was posted by Tony Ivanov (tony@gvgpvd.GVG.TEK.COM)
- X# in comp.os.vms on 5 December 1988
- X#
- X
- X# NOOP NO Optimiser
- XCFLAGS = /NOOP
- X
- X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
- X# -DAED AED 512 and AED 767
- X# -DBITGRAPH BBN BitGraph
- X# -DDXY800A Roland DXY800A plotter
- X# -DEPSON Epson LX-800, Star NL-10, NX-1000 and lots of others
- X# -DFIG Fig graphics language (requires object.h from TransFig)
- X# -DHP2648 HP2648, HP2647
- X# -DHP26 HP2623A and maybe others
- X# -DHP75 HP7580, and probably other HPs
- X# -DHPGL HP7475 and (hopefully) lots of others
- X# -DHPLJET HP Laserjet
- X# -DIMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
- X# -DIRIS4D IRIS4D series computer
- X# -DKERMIT MS-Kermit Tektronix 4010 emulator
- X# -DLATEX LATEX picture environment
- X# -DPOSTSCRIPT Postscript
- X# -DPROPRINTER IBM Proprinter
- X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
- X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
- X# -DSELANAR Selanar
- X# -DTEK Tektronix 4010, and probably others
- X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
- X# -DUNIXPLOT unixplot
- X# -DV384 Vectrix 384 and tandy color printer
- X
- X
- XTERMFLAGS = /define=(AED,BITGRAPH,DXY800A,HP2648,HP26,HP75,HPGL, \
- X KERMIT,LATEX,POSTSCRIPT,QMS,REGIS,SELANAR,TEK,V384)
- X
- XOBJS = command.obj,eval.obj,graphics.obj,internal.obj, \
- X misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, \
- X standard.obj,term.obj,util.obj,version.obj
- X
- XCSOURCE1 = command.c setshow.c
- XCSOURCE2 = help.c graphics.c internal.c
- XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
- XCSOURCE4 = term.c util.c version.c
- XCSOURCE5 = [.term]aed.trm [.term]dxy.trm [.term]epson.trm [.term]font5x7.trm \
- X [.term]hp26.trm [.term]hp2648.trm [.term]hpgl.trm \
- X [.term]hpljet.trm [.term]iris4d.trm [.term]latex.trm
- XCSOURCE6 = [.term]post.trm [.term]pc.trm [.term]qms.trm [.term]regis.trm \
- X [.term]tek.trm [.term]unixpc.trm [.term]unixplot.trm [.term]v384.trm \
- X [.term]imPcodes.h [.term]imagen.trm [.term]object.h [.term]fig.trm
- X
- X
- Xall : gnuplot.exe gnuplot.hlp gnuplot.hlb
- X
- X
- Xgnuplot.exe : $(OBJS)
- X link /exe=gnuplot $(OBJS) ,linkopt.vms/opt
- X
- Xgnuplot.hlp : doc2hlp.exe [.docs]gnuplot.doc [.docs]doc2hlp.com
- X $$@[.docs]doc2hlp.com
- X
- Xgnuplot.hlb : gnuplot.hlp
- X library/create/help gnuplot.hlb gnuplot.hlp
- X
- Xdoc2hlp.exe: [.docs]doc2hlp.c
- X cc [.docs]doc2hlp.c
- X link doc2hlp,linkopt.vms/opt
- X
- Xterm.obj : $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
- X cc $(CFLAGS) $(TERMFLAGS) term.c
- X
- X$(OBJS) : plot.h
- X
- Xcommand.obj help.obj misc.obj : help.h
- X
- Xcommand.obj graphics.obj misc.obj plot.obj setshow.obj : setshow.h
- X
- Xclean :
- X purge/log
- X del/log *.obj;*
- *-*-END-of-makefile.vms-*-*
- echo x - makefile.3b1
- sed 's/^X//' >makefile.3b1 <<'*-*-END-of-makefile.3b1-*-*'
- X#
- X# GNUPLOT Makefile for ATT 3b1 (ATT 7300 or the "unix-PC")
- X#
- X# Note: this makefile uses the shared library
- X#
- X
- X# directory where to install executables on 'make install'
- XDEST=/usr/local/bin
- X# directory for installing man page on 'make man_install'
- XMANDEST=/usr/man/manl
- X# where to install help file gnuplot.gih
- X#HELPDEST=/usr/local/lib/gnuplot.gih
- XHELPDEST=docs/gnuplot.gih
- X
- X# -DVFORK if you have vfork()
- X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
- X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
- X# -DNOCOPY if you don't have a memcpy() by any name
- X# -DGAMMA if you've got gamma(3)
- X# -O if you trust your compiler's optimizer
- XCC = cc
- XCFLAGS = -DGAMMA -O #-g
- X
- X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
- X# -DAED AED 512 and AED 767
- X# -DBITGRAPH BBN BitGraph
- X# -DDXY800A Roland DXY800A plotter
- X# -DEPSON Epson LX-800, Star NL-10, NX-1000 and lots of others
- X# -DFIG Fig graphics language (requires object.h from TransFig)
- X# -DHP2648 HP2648, HP2647
- X# -DHP26 HP2623A and maybe others
- X# -DHP75 HP7580, and probably other HPs
- X# -DHPGL HP7475 and (hopefully) lots of others
- X# -DHPLJET HP Laserjet
- X# -DIMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
- X# -DIRIS4D IRIS4D series computer
- X# -DKERMIT MS-Kermit Tektronix 4010 emulator
- X# -DLATEX LATEX picture environment
- X# -DPOSTSCRIPT Postscript
- X# -DPROPRINTER IBM Proprinter
- X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
- X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
- X# -DSELANAR Selanar
- X# -DTEK Tektronix 4010, and probably others
- X# -DSUN Sun Microsystems Workstation
- X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
- X# -DUNIXPLOT unixplot
- X# -DV384 Vectrix 384 and tandy color printer
- X
- XTERMFLAGS = -Iterm -DNEC -DUNIXPLOT -DUNIXPC
- X
- XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
- X plot.o scanner.o setshow.o standard.o term.o util.o
- X
- XDIRS = term demo bugtest docs docs/latextut translate
- XCSOURCE1 = command.c setshow.c
- XCSOURCE2 = help.c graphics.c internal.c
- XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
- XCSOURCE4 = term.c util.c version.c
- XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
- X term/hp26.trm term/hp2648.trm term/hpgl.trm \
- X term/hpljet.trm term/iris4d.trm term/latex.trm term/sun.trm
- XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
- X term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm \
- X term/imPcodes.h term/imagen.trm term/object.h term/fig.trm
- X# not C code, but still needed
- XETC = README README.gnutex makefile.unx makefile.vms linkopt.vms \
- X makefile.3b1 plot.h help.h setshow.h lasergnu \
- X demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
- X demo/simple.demo demo/polar.demo demo/electron.demo \
- X bugtest/README bugtest/printf.c bugtest/scanf.c \
- X bugtest/mscbug.c term/README
- X# PC-specific files
- XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
- X linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm
- X# Documentation and help files
- XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
- X docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
- X docs/gnuplot.1 docs/lasergnu.1 \
- X docs/titlepage.ms docs/titlepage.tex
- XDOCS2 = docs/gnuplot.doc
- XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
- X docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
- X docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
- X docs/latextut/header.tex docs/latextut/tutorial.tex
- X# gnutex->gnuplot translator
- XTSOURCE1 = translate/Makefile translate/README translate/command.c \
- X translate/eval.c translate/gnut2p.1 translate/internal.c \
- X translate/misc.c translate/parse.c translate/plot.c \
- X translate/plot.h translate/scanner.c translate/standard.c \
- X translate/test1 translate/test2 translate/util.c
- X
- X# -lplot iff you have -DUNIXPLOT
- X# -lsuntool -lsunwindow -lpixrect iff you have -DSUN
- X# -lgl_s if IRIS4D
- XLIBS = -lm -lplot
- X
- Xgnuplot: $(OBJS) version.o
- X ld /lib/crt0s.o /lib/shlib.ifile $(OBJS) version.o $(LIBS) -o gnuplot
- X
- Xdoc:
- X ( cd docs; make gnuplot.gih )
- X
- Xtranslate:
- X (cd translate; make)
- X
- Xall: gnuplot doc
- X
- Xinstall: gnuplot doc man_install
- X cp gnuplot lasergnu $(DEST)
- X strip $(DEST)/gnuplot
- X (cd docs; make install-unix HELPDEST=$(HELPDEST))
- X
- Xman_install: docs/gnuplot.1 docs/lasergnu.1
- X cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
- X
- Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
- X $(CC) $(CFLAGS) $(TERMFLAGS) -c term.c
- X
- X$(OBJS): plot.h
- X
- Xcommand.o:
- X cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
- X
- Xcommand.o help.o misc.o: help.h
- X
- Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
- X
- XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
- X $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
- X
- Xlint:
- X lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
- X
- Xclean:
- X rm -f *.o *~ term/*~
- X (cd docs; make clean)
- X (cd docs/latextut; make clean)
- X (cd translate; make clean)
- X
- Xspotless:
- X rm -f *.o *~ term/*~ TAGS gnuplot
- X (cd docs; make clean)
- X (cd docs/latextut; make spotless)
- X (cd translate; make spotless)
- *-*-END-of-makefile.3b1-*-*
- echo x - makefile.ult
- sed 's/^X//' >makefile.ult <<'*-*-END-of-makefile.ult-*-*'
- X#
- X# GNUPLOT Makefile for Ultrix
- X#
- X# Note: Ultrix standard cc compiler has a bug with static structure
- X# initializations [such as struct ts {int x;} tb[]={{100*0.32}};]
- X# and so this makefile uses vcc instead. If this isn't possible,
- X# and you get "line xx: illegal initialization", then you'll have
- X# to go into the .trm include file and compute all the floating point
- X# defines with a calculator.
- X
- X# directory where to install executables on 'make install'
- XDEST=/usr/local/bin
- X# directory for installing man page on 'make man_install'
- XMANDEST=/usr/man/manl
- X# where to install help file gnuplot.gih
- X#HELPDEST=/usr/local/lib/gnuplot.gih
- XHELPDEST=docs/gnuplot.gih
- X
- X# -DVFORK if you have vfork()
- X# -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
- X# -DBZERO if you need to use bzero() (another BSD feature) instead of memset()
- X# -DNOCOPY if you don't have a memcpy() by any name
- X# -DGAMMA if you've got gamma(3)
- X# -O if you trust your compiler's optimizer
- XCFLAGS = -DVFORK -DBCOPY -DBZERO -DGAMMA -O #-gx
- X
- X# Not wise to use vcc for everything because math.h isn't compatible with
- X# vcc. (How can they get away with this?)
- X#CC = vcc
- X
- X# -D<terminal> in TERMFLAGS iff you wish to support <terminal>
- X# -DAED AED 512 and AED 767
- X# -DBITGRAPH BBN BitGraph
- X# -DDXY800A Roland DXY800A plotter
- X# -DEPSON Epson LX-800, Star NL-10, NX-1000 and lots of others
- X# -DFIG Fig graphics language (requires object.h from TransFig)
- X# -DHP2648 HP2648, HP2647
- X# -DHP26 HP2623A and maybe others
- X# -DHP75 HP7580, and probably other HPs
- X# -DHPGL HP7475 and (hopefully) lots of others
- X# -DHPLJET HP Laserjet
- X# -DIMAGEN Imagen laser printers (300dpi) (requires -Iterm also)
- X# -DIRIS4D IRIS4D series computer
- X# -DKERMIT MS-Kermit Tektronix 4010 emulator
- X# -DLATEX LATEX picture environment
- X# -DPOSTSCRIPT Postscript
- X# -DPROPRINTER IBM Proprinter
- X# -DQMS QMS/QUIC laserprinter (Talaris 1200 and others)
- X# -DREGIS ReGis graphics (vt125, vt220, vt240, Gigis...)
- X# -DSELANAR Selanar
- X# -DTEK Tektronix 4010, and probably others
- X# -DSUN Sun Microsystems Workstation
- X# -DUNIXPC unixpc (ATT 3b1 or ATT 7300)
- X# -DUNIXPLOT unixplot
- X# -DV384 Vectrix 384 and tandy color printer
- X
- XTERMFLAGS = -Iterm -DAED -DBITGRAPH -DDXY800A -DEPSON -DHP2648 \
- X -DHP26 -DHP75 -DHPGL -DHPLJET -DIMAGEN -DKERMIT -DLATEX \
- X -DPOSTSCRIPT -DPROPRINTER -DQMS -DREGIS -DSELANAR -DTEK \
- X -DUNIXPLOT -DV384
- X
- X#TERMFLAGS = -Iterm -DIMAGEN
- X
- XOBJS = command.o eval.o graphics.o help.o internal.o misc.o parse.o\
- X plot.o scanner.o setshow.o standard.o term.o util.o
- X
- XDIRS = term demo bugtest docs docs/latextut translate
- XCSOURCE1 = command.c setshow.c
- XCSOURCE2 = help.c graphics.c internal.c
- XCSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c
- XCSOURCE4 = term.c util.c version.c
- XCSOURCE5 = term/aed.trm term/dxy.trm term/epson.trm term/font5x7.trm \
- X term/hp26.trm term/hp2648.trm term/hpgl.trm \
- X term/hpljet.trm term/iris4d.trm term/latex.trm term/sun.trm
- XCSOURCE6 = term/post.trm term/pc.trm term/qms.trm term/regis.trm \
- X term/tek.trm term/unixpc.trm term/unixplot.trm term/v384.trm \
- X term/imPcodes.h term/imagen.trm term/object.h term/fig.trm
- X# not C code, but still needed
- XETC = README README.gnutex makefile.unx makefile.vms linkopt.vms \
- X makefile.3b1 plot.h help.h setshow.h lasergnu \
- X demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
- X demo/simple.demo demo/polar.demo demo/electron.demo \
- X bugtest/README bugtest/printf.c bugtest/scanf.c \
- X bugtest/mscbug.c term/README
- X# PC-specific files
- XPC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
- X linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm
- X# Documentation and help files
- XDOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
- X docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
- X docs/gnuplot.1 docs/lasergnu.1 \
- X docs/titlepage.ms docs/titlepage.tex
- XDOCS2 = docs/gnuplot.doc
- XDOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
- X docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
- X docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
- X docs/latextut/header.tex docs/latextut/tutorial.tex
- X# gnutex->gnuplot translator
- XTSOURCE1 = translate/Makefile translate/README translate/command.c \
- X translate/eval.c translate/gnut2p.1 translate/internal.c \
- X translate/misc.c translate/parse.c translate/plot.c \
- X translate/plot.h translate/scanner.c translate/standard.c \
- X translate/test1 translate/test2 translate/util.c
- X
- X# -lplot iff you have -DUNIXPLOT
- X# -lsuntool -lsunwindow -lpixrect iff you have -DSUN
- X# -lgl_s if IRIS4D
- XLIBS = -lm -lplot
- X
- Xgnuplot: $(OBJS) version.o
- X vcc $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot
- X
- Xdoc:
- X ( cd docs; make gnuplot.gih )
- X
- Xtranslate:
- X (cd translate; make)
- X
- Xall: gnuplot doc
- X
- Xinstall: gnuplot doc man_install
- X cp gnuplot lasergnu $(DEST)
- X strip $(DEST)/gnuplot
- X (cd docs; make install-unix HELPDEST=$(HELPDEST))
- X
- Xman_install: docs/gnuplot.1 docs/lasergnu.1
- X cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
- X
- Xterm.o: $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
- X vcc $(CFLAGS) $(TERMFLAGS) -c term.c
- X
- X$(OBJS): plot.h
- X
- Xcommand.o:
- X cc $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
- X
- Xcommand.o help.o misc.o: help.h
- X
- Xcommand.o graphics.o misc.o plot.o setshow.o: setshow.h
- X
- XSOURCES=plot.h help.h setshow.h $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) \
- X $(CSOURCE4) $(CSOURCE5) $(CSOURCE6)
- X
- Xlint:
- X lint -hx $(CSOURCE1) $(CSOURCE2) $(CSOURCE3) $(CSOURCE4)
- X
- Xclean:
- X rm -f *.o *~ term/*~
- X (cd docs; make clean)
- X (cd docs/latextut; make clean)
- X (cd translate; make clean)
- X
- Xspotless:
- X rm -f *.o *~ term/*~ TAGS gnuplot
- X (cd docs; make clean)
- X (cd docs/latextut; make spotless)
- X (cd translate; make spotless)
- *-*-END-of-makefile.ult-*-*
- echo x - plot.h
- sed 's/^X//' >plot.h <<'*-*-END-of-plot.h-*-*'
- X/* GNUPLOT - plot.h */
- X/*
- X * Copyright (C) 1986, 1987, 1990 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
- X *
- X */
- X
- X
- X#define PROGRAM "G N U P L O T"
- X#define PROMPT "gnuplot> "
- X#define SHELL "/bin/sh" /* used if SHELL env variable not set */
- X
- X#define SAMPLES 160 /* default number of samples for a plot */
- X#define ZERO 1e-8 /* default for 'zero' set option */
- X
- X#ifndef TERM
- X/* default terminal is "unknown"; but see init_terminal */
- X#define TERM "unknown"
- X#endif
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- X
- X#define Pi 3.141592653589793
- X
- X
- X#define MAX_POINTS 1
- X#define MAX_LINE_LEN 1024 /* maximum number of chars allowed on line */
- X#define MAX_TOKENS 200
- X#define MAX_ID_LEN 50 /* max length of an identifier */
- X
- X
- X#define MAX_AT_LEN 150 /* max number of entries in action table */
- X#define STACK_DEPTH 100
- X#define NO_CARET (-1)
- X
- X
- X
- X
- X#ifdef vms
- X#define OS "VMS "
- X#endif
- X
- X
- X#ifdef unix
- X#define OS "unix "
- X#endif
- X
- X
- X#ifdef MSDOS
- X#define OS "MS-DOS "
- X#endif
- X
- X
- X#ifndef OS
- X#define OS ""
- X#endif
- X
- X
- X/*
- X * Note about VERYLARGE: This is the upper bound double (or float, if PC)
- X * numbers. This flag indicates very large numbers. It doesn't have to
- X * be the absolutely biggest number on the machine.
- X * If your machine doesn't have HUGE, or float.h,
- X * define VERYLARGE here.
- X *
- X * example:
- X#define VERYLARGE 1e38
- X */
- X
- X#ifdef PC
- X#include <float.h>
- X#define VERYLARGE FLT_MAX
- X#else
- X#ifdef vms
- X#include <float.h>
- X#define VERYLARGE DBL_MAX
- X#else
- X#define VERYLARGE HUGE
- X#endif
- X#endif
- X
- X
- X#define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
- X
- X
- X
- X
- X#ifdef vms
- X
- X
- X#define is_comment(c) ((c) == '#' || (c) == '!')
- X#define is_system(c) ((c) == '$')
- X
- X
- X#else /* vms */
- X
- X
- X#define is_comment(c) ((c) == '#')
- X#define is_system(c) ((c) == '!')
- X
- X
- X#endif /* vms */
- X
- X
- X/*
- X * If you're memcpy() has another name, define it below as bcopy() is.
- X * If you don't have a memcpy():
- X#define NOCOPY
- X */
- X
- X
- X#ifdef BCOPY
- X#define memcpy(dest,src,len) bcopy(src,dest,len)
- X#endif /* BCOPY */
- X
- X
- X#ifdef vms
- X#define memcpy(dest,src,len) lib$movc3(&len,src,dest)
- X#endif /* vms */
- X
- X
- X/*
- X * If you don't have BZERO, define it below.
- X */
- X#ifndef BZERO
- X#define bzero(dest,len) (void)(memset(dest, (char)NULL, len))
- X#endif /* BZERO */
- X
- X
- X#define top_of_stack stack[s_p]
- X
- X
- Xtypedef int BOOLEAN;
- X
- X#ifdef __ZTC__
- Xtypedef int (*FUNC_PTR)(...);
- X#else
- Xtypedef int (*FUNC_PTR)();
- X#endif
- X
- X
- Xenum operators {
- X PUSH, PUSHC, PUSHD, CALL, LNOT, BNOT, UMINUS, LOR, LAND, BOR, XOR,
- X BAND, EQ, NE, GT, LT, GE, LE, PLUS, MINUS, MULT, DIV, MOD, POWER,
- X FACTORIAL, BOOL, JUMP, JUMPZ, JUMPNZ, JTERN, SF_START
- X};
- X
- X
- X#define is_jump(operator) ((operator) >=(int)JUMP && (operator) <(int)SF_START)
- X
- X
- Xenum DATA_TYPES {
- X INT, CMPLX
- X};
- X
- X
- Xenum PLOT_TYPE {
- X FUNC, DATA
- X};
- X
- X
- Xenum PLOT_STYLE {
- X LINES, POINTS, IMPULSES, LINESPOINTS, DOTS
- X};
- X
- Xenum JUSTIFY {
- X LEFT, CENTRE, RIGHT
- X};
- X
- Xstruct cmplx {
- X double real, imag;
- X};
- X
- X
- Xstruct value {
- X enum DATA_TYPES type;
- X union {
- X int int_val;
- X struct cmplx cmplx_val;
- X } v;
- X};
- X
- X
- Xstruct lexical_unit { /* produced by scanner */
- X BOOLEAN is_token; /* true if token, false if a value */
- X struct value l_val;
- X int start_index; /* index of first char in token */
- X int length; /* length of token in chars */
- X};
- X
- X
- Xstruct ft_entry { /* standard/internal function table entry */
- X char *f_name; /* pointer to name of this function */
- X FUNC_PTR func; /* address of function to call */
- X};
- X
- X
- Xstruct udft_entry { /* user-defined function table entry */
- X struct udft_entry *next_udf; /* pointer to next udf in linked list */
- X char udf_name[MAX_ID_LEN+1]; /* name of this function entry */
- X struct at_type *at; /* pointer to action table to execute */
- X char *definition; /* definition of function as typed */
- X struct value dummy_value; /* current value of dummy variable */
- X};
- X
- X
- Xstruct udvt_entry { /* user-defined value table entry */
- X struct udvt_entry *next_udv; /* pointer to next value in linked list */
- X char udv_name[MAX_ID_LEN+1]; /* name of this value entry */
- X BOOLEAN udv_undef; /* true if not defined yet */
- X struct value udv_value; /* value it has */
- X};
- X
- X
- Xunion argument { /* p-code argument */
- X int j_arg; /* offset for jump */
- X struct value v_arg; /* constant value */
- X struct udvt_entry *udv_arg; /* pointer to dummy variable */
- X struct udft_entry *udf_arg; /* pointer to udf to execute */
- X};
- X
- X
- Xstruct at_entry { /* action table entry */
- X enum operators index; /* index of p-code function */
- X union argument arg;
- X};
- X
- X
- Xstruct at_type {
- X int a_count; /* count of entries in .actions[] */
- X struct at_entry actions[MAX_AT_LEN];
- X /* will usually be less than MAX_AT_LEN is malloc()'d copy */
- X};
- X
- X
- X/* Defines the type of a coordinate */
- X/* INRANGE and OUTRANGE points have an x,y point associated with them */
- Xenum coord_type {
- X INRANGE, /* inside plot boundary */
- X OUTRANGE, /* outside plot boundary, but defined */
- X UNDEFINED /* not defined at all */
- X};
- X
- Xstruct coordinate {
- X enum coord_type type; /* see above */
- X#ifdef PC
- X float x, y; /* memory is tight on PCs! */
- X#else
- X double x, y;
- X#endif /* PC */
- X};
- X
- X
- Xstruct curve_points {
- X struct curve_points *next_cp; /* pointer to next plot in linked list */
- X enum PLOT_TYPE plot_type;
- X enum PLOT_STYLE plot_style;
- X char *title;
- X int line_type;
- X int point_type;
- X int p_count; /* count of points in .points[] */
- X struct coordinate points[MAX_POINTS];
- X /* will usually be less in malloc()'d copy */
- X};
- X
- X
- Xstruct termentry {
- X char *name;
- X char *description;
- X unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
- X FUNC_PTR init,reset,text,scale,graphics,move,vector,linetype,
- X put_text,text_angle,justify_text,point,arrow;
- X};
- X
- X
- Xstruct text_label {
- X struct text_label *next; /* pointer to next label in linked list */
- X int tag; /* identifies the label */
- X double x,y;
- X enum JUSTIFY pos;
- X char text[MAX_LINE_LEN+1];
- X};
- X
- Xstruct arrow_def {
- X struct arrow_def *next; /* pointer to next arrow in linked list */
- X int tag; /* identifies the arrow */
- X double sx,sy; /* start position */
- X double ex,ey; /* end position */
- X};
- X
- X/* Tic-mark labelling definition; see set xtics */
- Xstruct ticdef {
- X int type; /* one of three values below */
- X#define TIC_COMPUTED 1 /* default; gnuplot figures them */
- X#define TIC_SERIES 2 /* user-defined series */
- X#define TIC_USER 3 /* user-defined points */
- X union {
- X struct { /* for TIC_SERIES */
- X double start, incr;
- X double end; /* ymax, if VERYLARGE */
- X } series;
- X struct ticmark *user; /* for TIC_USER */
- X } def;
- X};
- X
- X/* Defines one ticmark for TIC_USER style.
- X * If label==NULL, the value is printed with the usual format string.
- X * else, it is used as the format string (note that it may be a constant
- X * string, like "high" or "low").
- X */
- Xstruct ticmark {
- X double position; /* where on axis is this */
- X char *label; /* optional (format) string label */
- X struct ticmark *next; /* linked list */
- X};
- X
- X/*
- X * SS$_NORMAL is "normal completion", STS$M_INHIB_MSG supresses
- X
- X * printing a status message.
- X * SS$_ABORT is the general abort status code.
- X from: Martin Minow
- X decvax!minow
- X */
- X#ifdef vms
- X#include <ssdef.h>
- X#include <stsdef.h>
- X#define IO_SUCCESS (SS$_NORMAL | STS$M_INHIB_MSG)
- X#define IO_ERROR SS$_ABORT
- X#endif /* vms */
- X
- X
- X#ifndef IO_SUCCESS /* DECUS or VMS C will have defined these already */
- X#define IO_SUCCESS 0
- X#endif
- X#ifndef IO_ERROR
- X#define IO_ERROR 1
- X#endif
- X
- X/* Some key global variables */
- Xextern BOOLEAN screen_ok;
- Xextern BOOLEAN term_init;
- Xextern BOOLEAN undefined;
- Xextern struct termentry term_tbl[];
- X
- Xextern char *alloc();
- *-*-END-of-plot.h-*-*
- echo x - help.h
- sed 's/^X//' >help.h <<'*-*-END-of-help.h-*-*'
- X/* Exit status returned by help() */
- X#define H_FOUND 0 /* found the keyword */
- X#define H_NOTFOUND 1 /* didn't find the keyword */
- X#define H_ERROR (-1) /* didn't find the help file */
- X
- Xextern void FreeHelp(); /* use this if you need memory */
- *-*-END-of-help.h-*-*
- echo x - setshow.h
- sed 's/^X//' >setshow.h <<'*-*-END-of-setshow.h-*-*'
- X/* GNUPLOT - setshow.h */
- X/*
- X * Copyright (C) 1986, 1987, 1990 Thomas Williams, Colin Kelley
- X *
- X * Permission to use, copy, and distribute this software and its
- X * documentation for any purpose with or without fee is hereby granted,
- X * provided that the above copyright notice appear in all copies and
- X * that both that copyright notice and this permission notice appear
- X * in supporting documentation.
- X *
- X * Permission to modify the software is granted, but not the right to
- X * distribute the modified code. Modifications are to be distributed
- X * as patches to released version.
- X *
- X * This software is provided "as is" without express or implied warranty.
- X *
- X *
- X * AUTHORS
- X *
- X * Original Software:
- X * Thomas Williams, Colin Kelley.
- X *
- X * Gnuplot 2.0 additions:
- X * Russell Lang, Dave Kotz, John Campbell.
- X *
- X * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
- X *
- X */
- X
- X/*
- X * global variables to hold status of 'set' options
- X *
- X */
- Xextern BOOLEAN autoscale_x;
- Xextern BOOLEAN autoscale_y;
- Xextern BOOLEAN autoscale_lx;
- Xextern BOOLEAN autoscale_ly;
- Xextern BOOLEAN clip_points;
- Xextern BOOLEAN clip_lines1;
- Xextern BOOLEAN clip_lines2;
- Xextern char dummy_var[];
- Xextern char xformat[];
- Xextern char yformat[];
- Xextern enum PLOT_STYLE data_style, func_style;
- Xextern BOOLEAN grid;
- Xextern int key;
- Xextern double key_x, key_y; /* user specified position for key */
- Xextern BOOLEAN log_x, log_y;
- Xextern FILE* outfile;
- Xextern char outstr[];
- Xextern BOOLEAN polar;
- Xextern int samples;
- Xextern float xsize; /* scale factor for size */
- Xextern float ysize; /* scale factor for size */
- Xextern int term; /* unknown term is 0 */
- Xextern char title[];
- Xextern char xlabel[];
- Xextern char ylabel[];
- Xextern double xmin, xmax, ymin, ymax;
- Xextern double loff, roff, toff, boff;
- Xextern double zero; /* zero threshold, not 0! */
- X
- Xextern BOOLEAN xtics;
- Xextern BOOLEAN ytics;
- X
- Xextern struct ticdef xticdef;
- Xextern struct ticdef yticdef;
- X
- Xextern BOOLEAN tic_in;
- X
- Xextern struct text_label *first_label;
- Xextern struct arrow_def *first_arrow;
- X
- X/* The set and show commands, in setshow.c */
- Xextern void set_command();
- Xextern void show_command();
- X/* and some accessible support functions */
- Xextern enum PLOT_STYLE get_style();
- Xextern BOOLEAN load_range();
- Xextern void show_version();
- *-*-END-of-setshow.h-*-*
- echo x - lasergnu
- sed 's/^X//' >lasergnu <<'*-*-END-of-lasergnu-*-*'
- X#!/bin/csh -f
- X#
- X# Print gnuplot output on an Imagen or Postscript laser printer.
- X
- Xset print_banner = on # Print a banner page unless told otherwise.
- Xset input_files = () # the plot input command files
- X
- X# Default printer set by shell variable LASER.
- Xif !($?LASER) then
- X set LASER = "imagen018"
- Xendif
- Xset printer = (-P$LASER)
- X
- X# File for plot commands, and for plot output
- Xset TMP=/tmp/plot$$
- Xset outfile=$TMP.out # the output file
- Xonintr cleanup
- X
- X# default is Imagen mode for Imagen printer; see -p option
- Xset setterm="set terminal imagen"
- Xset LANG="-Limpress"
- X
- Xset usage="usage: lasergnu [-Pprinter] [-b] [-p] [-t title] [-f file] ['plot command']...."
- X
- X# Loop through the command-line arguments.
- X
- Xtop:
- X if ($#argv > 0) then
- X
- X switch ("$argv[1]")
- X
- X case -b*: # Do not print a banner page.
- X case -J*: # Compatible with imprint.
- X set print_banner = off
- X shift argv
- X goto top
- X
- X case -f?*: # Specify file containing plot commands
- X set input_files = ($input_files `echo $argv[1] | sed 's/^-f//'`)
- X shift argv
- X goto top
- X
- X case -f: # Specify file containing plot commands
- X shift argv
- X if ($#argv > 0) then
- X set input_files = ($input_files $argv[1])
- X shift argv
- X else
- X echo "Usage: -f file ..."
- X echo "Type lasergnu -help for help."
- X exit (1)
- X endif
- X goto top
- X
- X case -t?*: # Specify title of plot
- X echo set title \""`echo $argv[1] | sed 's/^-t//'`"\" >> $TMP
- X shift argv
- X goto top
- X
- X case -t: # Specify title of plot
- X shift argv
- X if ($#argv > 0) then
- X echo set title \""$1"\" >> $TMP
- X shift argv
- X else
- X echo "Usage: -t title ..."
- X echo "Type lasergnu -help for help."
- X exit (1)
- X endif
- X goto top
- X case -help:
- X echo "$usage"
- X exit(1)
- X
- X case -P?*: # Set the printer, exactly as by itroff.
- X set printer = $argv[1]
- X shift argv
- X goto top
- X
- X case -P: # Set the printer, exactly as by itroff.
- X shift argv
- X if ($#argv > 0) then
- X set printer = (-P$argv[1])
- X shift argv
- X else
- X echo "Usage: -P printer ..."
- X echo "Type lasergnu -help for help."
- X exit (1)
- X endif
- X goto top
- X
- X # use impress
- X case -I:
- X echo Imagen is the default mode now
- X shift argv
- X goto top
- X
- X # use postscript instead of impress language
- X case -p:
- X set setterm="set term postscript"
- X set LANG="-Lpostscript"
- X shift argv
- X goto top
- X
- X case -?*:
- X echo "I do not recognize option $argv[1]."
- X echo "$usage"
- X exit (1)
- X
- X default:
- X echo "$argv[1]" >> $TMP
- X shift argv
- X goto top
- X
- X endsw
- X endif
- X
- X# try to devine the printer type
- Xif ($printer =~ -Plw*) then
- X set setterm="set term postscript"
- X set LANG="-Lpostscript"
- Xendif
- X
- Xif ($printer =~ -Pim*) then
- X set setterm="set term imagen"
- X set LANG="-Limpress"
- Xendif
- X
- X# Set up input file
- Xecho $setterm > $TMP.plt
- Xecho set output \"$outfile\" >> $TMP.plt
- Xif (-e $TMP) cat $TMP >> $TMP.plt
- X
- X# If input file is specified AND command line contains plot commands, then
- X# do command line args first, then plot commands in input file.
- Xgnuplot $TMP.plt $input_files
- X
- Xif ($status == 0 && -e $outfile && ! -z $outfile) then
- X # The printer is whatever printer was last specified,
- X # or the default printer if none was specified.
- X if ($LANG == -Limpress) then
- X /usr/local/bin/ipr $LANG $printer \
- X -D"jobheader $print_banner" \
- X -D"pagereversal on" \
- X -D"program lasergnu" $outfile
- X else if ($LANG == -Lpostscript) then
- X lpr $printer $outfile
- X endif
- Xelse
- X echo "lasergnu: error in plotting or empty plot; nothing printed."
- Xendif
- X
- Xcleanup:
- Xrm -f $TMP* $outfile
- *-*-END-of-lasergnu-*-*
- echo x - demo/1.dat
- sed 's/^X//' >demo/1.dat <<'*-*-END-of-demo/1.dat-*-*'
- X-20.000000 -3.041676
- X-19.000000 -3.036427
- X-18.000000 -3.030596
- X-17.000000 -3.024081
- X-16.000000 -3.016755
- X-15.000000 -3.008456
- X-14.000000 -2.998978
- X-13.000000 -2.988049
- X-12.000000 -2.975310
- X-11.000000 -2.960273
- X-10.000000 -2.942255
- X-9.000000 -2.920278
- X-8.000000 -2.892883
- X-7.000000 -2.857799
- X-6.000000 -2.811295
- X-5.000000 -2.746802
- X-4.000000 -2.651635
- X-3.000000 -2.498092
- X-2.000000 -2.214297
- X-1.000000 -1.570796
- X0.000000 0.000000
- X1.000000 1.570796
- X2.000000 2.214297
- X3.000000 2.498092
- X4.000000 2.651635
- X5.000000 2.746802
- X6.000000 2.811295
- X7.000000 2.857799
- X8.000000 2.892883
- X9.000000 2.920278
- X10.000000 2.942255
- X11.000000 2.960273
- X12.000000 2.975310
- X13.000000 2.988049
- X14.000000 2.998978
- X15.000000 3.008456
- X16.000000 3.016755
- X17.000000 3.024081
- X18.000000 3.030596
- X19.000000 3.036427
- *-*-END-of-demo/1.dat-*-*
- echo x - demo/2.dat
- sed 's/^X//' >demo/2.dat <<'*-*-END-of-demo/2.dat-*-*'
- X-20.000000 -6.083352
- X-19.000000 -6.072853
- X-18.000000 -6.061191
- X-17.000000 -6.048162
- X-16.000000 -6.033510
- X-15.000000 -6.016913
- X-14.000000 -5.997955
- X-13.000000 -5.976098
- X-12.000000 -5.950620
- X-11.000000 -5.920546
- X-10.000000 -5.884511
- X-9.000000 -5.840556
- X-8.000000 -5.785765
- X-7.000000 -5.715597
- X-6.000000 -5.622591
- X-5.000000 -5.493603
- X-4.000000 -5.303271
- X-3.000000 -4.996183
- X-2.000000 -4.428595
- X-1.000000 -3.141593
- X0.000000 0.000000
- X1.000000 3.141593
- X2.000000 4.428595
- X3.000000 4.996183
- X4.000000 5.303271
- X5.000000 5.493603
- X6.000000 5.622591
- X7.000000 5.715597
- X8.000000 5.785765
- X9.000000 5.840556
- X10.000000 5.884511
- X11.000000 5.920546
- X12.000000 5.950620
- X13.000000 5.976098
- X14.000000 5.997955
- X15.000000 6.016913
- X16.000000 6.033510
- X17.000000 6.048162
- X18.000000 6.061191
- X19.000000 6.072853
- *-*-END-of-demo/2.dat-*-*
- echo x - demo/3.dat
- sed 's/^X//' >demo/3.dat <<'*-*-END-of-demo/3.dat-*-*'
- X-20.000000 -9.125028
- X-19.000000 -9.109280
- X-18.000000 -9.091787
- X-17.000000 -9.072243
- X-16.000000 -9.050265
- X-15.000000 -9.025369
- X-14.000000 -8.996933
- X-13.000000 -8.964147
- X-12.000000 -8.925931
- X-11.000000 -8.880819
- X-10.000000 -8.826766
- X-9.000000 -8.760835
- X-8.000000 -8.678648
- X-7.000000 -8.573396
- X-6.000000 -8.433886
- X-5.000000 -8.240405
- X-4.000000 -7.954906
- X-3.000000 -7.494275
- X-2.000000 -6.642892
- X-1.000000 -4.712389
- X0.000000 0.000000
- X1.000000 4.712389
- X2.000000 6.642892
- X3.000000 7.494275
- X4.000000 7.954906
- X5.000000 8.240405
- X6.000000 8.433886
- X7.000000 8.573396
- X8.000000 8.678648
- X9.000000 8.760835
- X10.000000 8.826766
- X11.000000 8.880819
- X12.000000 8.925931
- X13.000000 8.964147
- X14.000000 8.996933
- X15.000000 9.025369
- X16.000000 9.050265
- X17.000000 9.072243
- X18.000000 9.091787
- X19.000000 9.109280
- *-*-END-of-demo/3.dat-*-*
- echo x - demo/controls.demo
- sed 's/^X//' >demo/controls.demo <<'*-*-END-of-demo/controls.demo-*-*'
- X#
- X# warning: this demo is SLOW on PCs without math coprocessors!
- X#
- X# From _Automatic_Control_Systems_, fourth ed., figure 6-14
- X# transient response of a second-order system to a unit step input function
- X#
- Xdamp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
- Xper(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
- Xc(t) = 1-damp(t)*per(t)
- X#
- X# wn is natural undamped frequency
- X# s is damping factor
- X#
- Xwn = 1.0
- Xset xrange [0:13]
- Xset samples 50
- Xset dummy t
- X#
- X# plot c(t) for several different damping factors s
- X#
- 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)
- Xpause -1 "Hit return to continue"
- X
- X# undo what we have done
- Xset xrange [-10:10]
- Xset autoscale xy
- Xset samples 160
- Xset dummy x
- X
- *-*-END-of-demo/controls.demo-*-*
- echo x - demo/simple.demo
- sed 's/^X//' >demo/simple.demo <<'*-*-END-of-demo/simple.demo-*-*'
- X#
- X# Requires data files "[123].dat" from this directory,
- X# so change current working directory to this directory before running.
- X# gnuplot> set term <term-type>
- X# gnuplot> load 'simple.demo'
- X#
- Xset samples 50
- Xplot [-10:10] sin(x),atan(x),cos(atan(x))
- Xpause -1 "Hit return to continue"
- X
- Xset samples 100
- Xplot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1))
- Xpause -1 "Hit return to continue"
- X
- Xset samples 200
- Xplot [-3:5] asin(x),acos(x)
- Xpause -1 "Hit return to continue"
- X
- Xplot [-30:20] besj0(x)*0.12e1 with impulses, (x**besj0(x))-2.5 with points
- Xpause -1 "Hit return to continue"
- X
- Xset samples 400
- Xplot [-10:10] real(sin(x)**besj0(x))
- Xpause -1 "Hit return to continue"
- X
- Xplot [-5*pi:5*pi] [-5:5] real(tan(x)/atan(x)), 1/x
- Xpause -1 "Hit return to continue"
- X
- Xset autoscale
- Xset samples 800
- Xplot [-30:20] sin(x*20)*atan(x)
- Xpause -1 "Hit return to continue"
- X
- Xplot [-19:19] '1.dat'with impulses ,'2.dat' ,'3.dat' with lines
- Xpause -1 "Hit return to continue"
- X
- X# undo what we have done above
- Xset samples 160
- Xset xrange [-10:10]
- Xset autoscale xy
- *-*-END-of-demo/simple.demo-*-*
- echo x - demo/polar.demo
- sed 's/^X//' >demo/polar.demo <<'*-*-END-of-demo/polar.demo-*-*'
- X#
- X# Show some of the new polar capabilities.
- X#
- Xset polar
- Xset dummy x
- Xset samples 160
- Xset xrange [0:2*pi]
- Xset title "Three circles (with aspect ratio distortion)"
- Xplot .5,1,1.5
- Xpause -1 "Hit return"
- Xset title ""
- X
- Xplot cos(2*x)
- Xpause -1 "Hit return"
- X
- Xplot 2*sqrt(cos(x)),-2*sqrt(cos(x))
- Xpause -1 "Hit return"
- X
- Xset offset pi/4,pi/4,0,0
- Xplot sin(4*x),cos(4*x)
- Xset offset 0,0,0,0
- Xpause -1 "Hit return"
- X
- Xset yrange [-5:5]
- Xplot x/cos(3*x)
- Xpause -1 "Hit return"
- Xset autoscale
- X
- Xplot 1-sin(x)
- Xpause -1 "Hit return"
- X
- Xset xrange [0:12*pi]
- Xplot 2*x
- Xpause -1 "Hit return"
- X
- Xbutterfly(x)=exp(cos(x))-2*cos(4*x)+sin(x/12)**5
- Xset samples 800
- Xpause 0 "This is a big one (many samples), be patient..."
- Xset title "Butterfly"
- Xset nokey
- Xplot butterfly(x)
- Xpause -1 "Hit return"
- X
- X# undo what we've done above
- Xset nopolar
- Xset samples 160
- Xset autoscale xy
- Xset title ""
- Xset offset 0,0,0,0
- Xset key
- *-*-END-of-demo/polar.demo-*-*
- echo x - demo/electron.demo
- sed 's/^X//' >demo/electron.demo <<'*-*-END-of-demo/electron.demo-*-*'
- X# Electronics demo
- X#
- X# Bipolar Transistor (NPN) Mutual Characteristic
- XIe(Vbe)=Ies*exp(Vbe/kT_q)
- XIc(Vbe)=alpha*Ie(Vbe)+Ico
- Xalpha = 0.99
- XIes = 4e-14
- XIco = 1e-09
- XkT_q = 0.025
- Xset dummy Vbe
- Xset grid
- Xset offsets
- Xset nolog
- Xset nopolar
- Xset samples 160
- Xset title "Mutual Characteristic of a Transistor"
- Xset xlabel "Vbe (base emmitter voltage)"
- Xset xrange [0 : 0.75]
- Xset ylabel "Ic (collector current)"
- Xset yrange [0 : 0.005]
- Xset key .2,.0045
- Xset format y "%.4f"
- Xplot Ic(Vbe)
- Xset format "%g"
- X
- Xpause -1 "Hit return to continue"
- X
- X# Junction Field Effect Transistor (JFET) Mutual Characteristic
- X# drain current above pinch off
- XIda(Vd)=Ido*(1-Vg/Vp)**2
- X# drain current below pinch off
- XIdb(Vd)=Ido*(2*Vd*(Vg-Vp)-Vd*Vd)/(Vp*Vp)
- X# drain current
- XId(Vd)= (Vd>Vg-Vp) ? Ida(Vd) : Idb(Vd)
- X# drain current at zero gate voltage
- XIdo = 2.5
- X# pinch off voltage
- XVp = -1.25
- X# gate voltage
- XVg = 0
- Xset dummy Vd
- Xset nogrid
- Xset nokey
- Xset offsets 0, 1, 0, 0
- Xset title "JFET Mutual Characteristic"
- Xset xlabel "Drain voltage Vd (V)"
- Xset xrange [0 : 4]
- Xset ylabel "Drain current Id (mA)"
- Xset yrange [0 : 5]
- Xset label "-0.5 Vp" at 4.1,0.625
- Xset label "-0.25 Vp" at 4.1,1.4
- Xset label "0" at 4.1,2.5
- Xset label "Vg = 0.5 Vp" at 4.1,3.9
- Xplot Vg=0.5*Vp,Id(Vd),Vg=0.25*Vp,Id(Vd),Vg=0,Id(Vd),Vg=-0.25*Vp,Id(Vd)
- Xset nolabel
- X
- Xpause -1 "Hit return to continue"
- X
- X# amplitude frequency response
- XA(jw) = ({0,1}*jw/({0,1}*jw+p1)) * (1/(1+{0,1}*jw/p2))
- Xp1 = 10
- Xp2 = 10000
- Xset dummy jw
- Xset grid
- Xset key
- Xset logscale xy
- Xset offsets 0, 0, 0, 0
- Xset title "Amplitude Frequency Response"
- Xset xlabel "jw (radians)"
- Xset xrange [1.1 : 90000.0]
- Xset ylabel "magnitude of A(jw)"
- Xset autoscale y
- Xplot abs(A(jw))
- X
- Xpause -1 "Hit return"
- X
- X# phase frequency response
- Xset nolog y
- Xset logscale x
- Xset title "Phase Frequency Response"
- Xset ylabel "Phase of A(jw) (degrees)"
- Xplot 180/pi*arg(A(jw))
- X
- Xpause -1 "Hit return"
- X
- X# undo what we've done
- Xset dummy x
- Xset nogrid
- Xset offsets 0,0,0,0
- Xset title ""
- Xset ylabel ""
- Xset xlabel ""
- Xset xrange [-10:10]
- Xset autoscale xy
- Xset key
- Xset format xy "%g"
- Xset nolabel
- Xset nolog
- *-*-END-of-demo/electron.demo-*-*
- echo x - bugtest/README
- sed 's/^X//' >bugtest/README <<'*-*-END-of-bugtest/README-*-*'
- XThese two programs demonstrate some of the bugs in the SunOS stdio
- Xlibrary. The explanation, from `help bugs` in gnuplot:
- X
- X The most important known bug is actually in the stdio library for the
- X Sun4 operating system (SunOS Sys4-3.2). The "%g" format for `printf`
- X sometimes incorrectly prints numbers (e.g., 200000.0 as "2"). Thus,
- X tic mark labels may be incorrect on a Sun4 version of gnuplot. You
- X may work around it by rescaling your data or by using the `set format`
- X command to change the tic mark format to "%7.0f" or some other
- X appropriate format. This appears to have been fixed in SunOS 4.0.
- X
- X Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
- X and SunOS 4.0, the `sscanf` routine incorrectly parses "00 12" with
- X the format "%f %f" and reads 0 and 0 instead of 0 and 12. This
- X affects data input. If your data file contains X coordinates that are
- X zero but are specified like '00', '000', etc, then you will read the
- X wrong Y values. Check your data files or do not use a Sun4 until they
- X fix the bug. It does NOT appear that this has been fixed in SunOS
- X 4.0, at least by 4.0.3.
- X
- X
- Xcompile with
- X cc printf.c -o printf
- X cc scanf.c -o scanf
- X
- XDavid Kotz
- XDecember 1989
- X
- X----------------
- X
- XThe program mscbug.c demonstrates a bug in Microsoft C 5.1.
- X
- XThe explanation, from `help bugs` in gnuplot:
- X Microsoft C 5.1 has a nasty bug associated with the %g format for
- X printf. When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are
- X used, printf will incorrectly print numbers in the range 1e-4 to 1e-1.
- X Numbers that should be printed in the %e format are incorrectly
- X printed in the %f format, with the wrong number of zeros after the
- X decimal point.
- X To work around this problem, use the %e or %f formats explicitly.
- X
- Xcompile with
- X cl mscbug.c
- X
- XRussell Lang
- XJanuary 1990
- *-*-END-of-bugtest/README-*-*
- echo x - bugtest/printf.c
- sed 's/^X//' >bugtest/printf.c <<'*-*-END-of-bugtest/printf.c-*-*'
- X#include <stdio.h>
- X
- Xmain()
- X{
- X printf("%g %g %g %g %g %g %g\n",
- X 2., 20., 200., 2000., 20000., 200000., 2000000.);
- X}
- *-*-END-of-bugtest/printf.c-*-*
- echo x - bugtest/scanf.c
- sed 's/^X//' >bugtest/scanf.c <<'*-*-END-of-bugtest/scanf.c-*-*'
- X#include <stdio.h>
- X
- Xmain()
- X{
- X float x,y;
- X
- X sscanf("0 12", "%f %f\n", &x, &y);
- X printf("%f, %f should be %f, %f\n", x, y, 0., 12.);
- X
- X sscanf("00 12", "%f %f\n", &x, &y);
- X printf("%f, %f should be %f, %f\n", x, y, 0., 12.);
- X}
- *-*-END-of-bugtest/scanf.c-*-*
- echo x - bugtest/mscbug.c
- sed 's/^X//' >bugtest/mscbug.c <<'*-*-END-of-bugtest/mscbug.c-*-*'
- X#include <stdio.h>
- X
- Xmain()
- X{
- Xdouble x;
- X
- X printf("look at the fourth, fifth and sixth columns\n");
- X printf("%%e\t\t %%f\t\t %%g\t %%.g\t %%.1g\t %%.2g\t %%.3g\n\n");
- X for ( x = 1e-6; x < 1e+4; x *= 10.0 )
- X printf("%e\t %f\t %g\t %.g\t %.1g\t %.2g\t %.3g\n",
- X x,x,x,x,x,x,x);
- X}
- *-*-END-of-bugtest/mscbug.c-*-*
- echo x - term/README
- sed 's/^X//' >term/README <<'*-*-END-of-term/README-*-*'
- XDOCUMENTATION FOR GNUPLOT TERMINAL DRIVER WRITERS
- XBy Russell Lang 1/90
- X
- XInformation on each terminal device driver is contained in term.c and
- Xthe term/*.trm files. Each driver is contained in a .trm file and is
- X#include'd into term.c. Each driver has a set of initialisers in
- Xterm.c for term_tbl[], an array of struct termentry.
- X
- XHere is the definition of the struct termentry from plot.h:
- X
- Xstruct termentry {
- X char *name;
- X char *description;
- X unsigned int xmax,ymax,v_char,h_char,v_tic,h_tic;
- X FUNC_PTR init,reset,text,scale,graphics,move,vector,linetype,
- X put_text,text_angle,justify_text,point,arrow;
- X};
- X
- XHere's a brief description of each variable:
- X
- XThe char *name is a pointer to a string containing the name
- Xof the terminal. This name is used by the 'set terminal' and
- X'show terminal' commands.
- XThe name must be unique and must not be confused with an abbreviation
- Xof another name. For example if the name "postscript" exists, it is not
- Xpossible to have another name "postscript2".
- XKeep the name under 15 characters.
- X
- XThe char *description is a pointer to a string containing a
- Xdescription of the terminal, which is displayed in response
- Xto the 'set terminal' command.
- XKeep the description under 60 characters.
- X
- Xxmax is the maximum number of points in the x direction.
- XThe range of points used by gnuplot is 0 to xmax-1.
- X
- Xymax is the maximum number of points in the y direction.
- XThe range of points used by gnuplot is 0 to ymax-1.
- X
- Xv_char is the height of characters, in the same units as xmax and ymax.
- XThe border for labelling at the top and bottom of the plot is
- Xcalculated using v_char.
- Xv_char is used as the vertical line spacing for characters.
- X
- Xh_char is the width of characters, in the same units as xmax and ymax.
- XThe border for labelling at the left and right of the plot is
- Xcalculated using h_char.
- XIf the _justify_text function returns FALSE, h_char is used to justify
- Xtext right or centre. If characters are not fixed width, then the
- X_justify_text function must correctly justify the text.
- X
- Xv_tic is the vertical size of tics along the x axis,
- Xin the same units as ymax.
- X
- Xh_tic is the horizontal size of tics along the y axis,
- Xin the same units as xmax.
- X
- X
- XHere's a brief description of what each term.c function does:
- X
- X_init() Called once, when the device is first selected. This procedure
- Xshould set up things that only need to be set once, like handshaking and
- Xcharacter sets etc...
- X
- X_reset() Called when gnuplot is exited, the output device changed or
- Xthe terminal type changed. This procedure should reset the device,
- Xpossibly flushing a buffer somewhere or generating a form feed.
- X
- X_scale(xs,ys) Called just before _graphics(). This takes the x and y
- Xscaling factors as information. If the terminal would like to do its
- Xown scaling, it returns TRUE. Otherwise, it can ignore the information
- Xand return FALSE: do_plot will do the scaling for you. null_scale is
- Xprovided to do just this, so most drivers can ignore this function
- Xentirely. The Latex driver is currently the only one providing its own
- Xscaling.
- X
- X_graphics() Called just before a plot is going to be displayed. This
- Xprocedure should set the device into graphics mode. Devices which can't
- Xbe used as terminals (like plotters) will probably be in graphics mode
- Xalways and therefore won't need this.
- X
- X_text() Called immediately after a plot is displayed. This procedure
- Xshould set the device back into text mode if it is also a terminal, so
- Xthat commands can be seen as they're typed. Again, this will probably
- Xdo nothing if the device can't be used as a terminal.
- X
- X_move(x,y) Called at the start of a line. The cursor should move to the
- X(x,y) position without drawing.
- X
- X_vector(x,y) Called when a line is to be drawn. This should display a line
- Xfrom the last (x,y) position given by _move() or _vector() to this new (x,y)
- Xposition.
- X
- X_linetype(lt) Called to set the line type before text is displayed or
- Xline(s) plotted. This procedure should select a pen color or line
- Xstyle if the device has these capabilities.
- Xlt is an integer from -2 to 0 or greater.
- XAn lt of -2 is used for the border of the plot.
- XAn lt of -1 is used for the X and Y axes.
- Xlt 0 and upwards are used for plots 0 and upwards.
- XIf _linetype() is called with lt greater than the available line types,
- Xit should map it to one of the available line types.
- XMost drivers provide 9 different linetypes (lt is 0 to 8).
- X
- X_put_text(x,y,str) Called to display text at the (x,y) position,
- Xwhile in graphics mode. The text should be vertically (with respect
- Xto the text) justified about (x,y). The text is rotated according
- Xto _text_angle and then horizontally (with respect to the text)
- Xjustified according to _justify_text.
- X
- X_text_angle(ang) Called to rotate the text angle when placing the y label.
- XIf ang = 0 then text is horizontal. If ang = 1 then text is vertically
- Xupwards. Returns TRUE if text can be rotated, FALSE otherwise.
- X
- X_justify_text(mode) Called to justify text left, right or centre.
- XIf mode = LEFT then text placed by _put_text is flushed left against (x,y).
- XIf mode = CENTRE then centre of text is at (x,y).
- XIf mode = RIGHT then text is placed flushed right against (x,y).
- XReturns TRUE if text can be justified
- XReturns FALSE otherwise and then _put_text assumes text is flushed left;
- Xjustification of text is then performed by calculating the text width
- Xusing strlen(text) * h_char.
- X
- X_point(x,y,point) Called to place a point at position (x,y).
- Xpoint is -1 or an integer from 0 upwards.
- X6 point types (numbered 0 to 5) are normally provided.
- XPoint type -1 is a dot.
- XIf point is more than the available point types then it should
- Xbe mapped back to one of the available points.
- XTwo _point() functions called do_point() and line_and_point() are
- Xprovided in term.c and should be suitable for most drivers.
- Xdo_point() draws the points in the current line type.
- XIf your driver uses dotted line types (generally because it is
- Xmonochrome), you should use line_and_point() which changes to
- Xline type 0 before drawing the point. line type 0 should be solid.
- X
- X
- X_arrow(sx,sy,ex,ey) Called to draw an arrrow from (sx,sy) to (ex,ey).
- XAn _arrow() function called do_arrow() is provided in term.c which will
- Xdraw arrows using the _move() and _vector() functions.
- XDrivers should use do_arrow unless it causes problems.
- X
- X
- XThe following should illustrate the order in which calls to these
- Xroutines are made:
- X
- X _init()
- X _scale(xs,ys)
- X _graphics()
- X _linetype(lt)
- X _move(x,y)
- X _vector(x,y)
- X _point(x,y,point)
- X _text_angle(angle)
- X _justify(mode)
- X _put_text(x,y,text)
- X _arrow(sx,sy,ex,ey)
- X _text()
- X _graphics()
- X .
- X .
- X _text()
- X _reset()
- X
- X
- *-*-END-of-term/README-*-*
- echo x - linkopt.vms
- sed 's/^X//' >linkopt.vms <<'*-*-END-of-linkopt.vms-*-*'
- Xsys$library:vaxcrtl/share
- *-*-END-of-linkopt.vms-*-*
- echo x - buildvms.com
- sed 's/^X//' >buildvms.com <<'*-*-END-of-buildvms.com-*-*'
- X$ ! buildvms.com (Command file to compile/link gnuplot and doc2hlp)
- X$ CFLAGS = "/NOOP"
- X$ TERMFLAGS = "/define=(AED,BITGRAPH,DXY800A,HP2648,HP26,HP75,HPGL,KERMIT,LATEX,POSTSCRIPT,QMS,REGIS,SELANAR,TEK,V384)"
- X$ set verify
- X$ cc 'CFLAGS' command.c
- X$ cc 'CFLAGS' eval.c
- X$ cc 'CFLAGS' graphics.c
- X$ cc 'CFLAGS' internal.c
- X$ cc 'CFLAGS' misc.c
- X$ cc 'CFLAGS' parse.c
- X$ cc 'CFLAGS' plot.c
- X$ cc 'CFLAGS' scanner.c
- X$ cc 'CFLAGS' setshow.c
- X$ cc 'CFLAGS' standard.c
- X$ cc 'CFLAGS' 'TERMFLAGS' term.c
- X$ cc 'CFLAGS' util.c
- X$ cc 'CFLAGS' version.c
- X$ link /exe=gnuplot -
- X command.obj,eval.obj,graphics.obj,internal.obj, -
- X misc.obj,parse.obj,plot.obj,scanner.obj,setshow.obj, -
- X standard.obj,term.obj,util.obj,version.obj ,linkopt.vms/opt
- X$ cc [.docs]doc2hlp.c
- X$ link doc2hlp,linkopt.vms/opt
- X$ @[.docs]doc2hlp.com
- X$ library/create/help gnuplot.hlb gnuplot.hlp
- X$ set noverify
- X
- *-*-END-of-buildvms.com-*-*
- exit
-
-
-