dfk@romeo.cs.duke.edu (David F. Kotz) (02/13/89)
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# patch5a
# This archive created: Sun Feb 12 13:16:10 1989
export PATH; PATH=/bin:$PATH
if test -f 'patch5a'
then
echo shar: will not over-write existing file "'patch5a'"
else
sed 's/^X//' << \SHAR_EOF > 'patch5a'
XCommon subdirectories: ../gnutex.old/Help and ./Help
Xdiff -cr ../gnutex.old/Makefile ./Makefile
X*** ../gnutex.old/Makefile Fri Feb 10 12:16:04 1989
X--- ./Makefile Fri Feb 10 12:12:21 1989
X***************
X*** 14,24 ****
X DESTDIR=/usr/local/bin/
X MANDIR=/usr/man/manl
X
X! # -lplot iff UNIXPLOT you have -DUNIXPLOT
X LIBS = -lm -lplot
X
X # -DVFORK iff vfork() supported
X! CFLAGS = -DVFORK
X
X # -D<terminal> only if you wish to support <terminal>
X # -DAED Aed767
X--- 14,32 ----
X DESTDIR=/usr/local/bin/
X MANDIR=/usr/man/manl
X
X! # The name of the help file (./gnutex.help installed as $(HELPFILE))
X! HELPFILE=/usr/local/lib/gnutex.help
X! COMMANDFLAGS=-IHelp -DHELPFILE=\"$(HELPFILE)\"
X!
X! # -lplot iff you have -DUNIXPLOT below
X LIBS = -lm -lplot
X
X+ # Pick either index() on BSD or strchr() on System V and MS-DOS
X+ INDEX=-DINDEX=index
X+ #INDEX=-DINDEX=strchr
X+
X # -DVFORK iff vfork() supported
X! CFLAGS = -DVFORK $(INDEX)
X
X # -D<terminal> only if you wish to support <terminal>
X # -DAED Aed767
X***************
X*** 31,40 ****
X # -DPC IBM PC EGA/CGA graphics
X # -DPC -DCORONA IBM PC Corona graphics
X # -DLATEX LaTeX output
X
X! #TERMFLAGS = -DQMS -DTEK -DHALFTEK -DUNIXPLOT -DLATEX
X! TERMFLAGS = -DTEK -DUNIXPLOT -DLATEX
X! #TERMFLAGS = -DLATEX
X
X # Your favorite tags program
X TAGS=etags
X--- 39,49 ----
X # -DPC IBM PC EGA/CGA graphics
X # -DPC -DCORONA IBM PC Corona graphics
X # -DLATEX LaTeX output
X+ # -DIMAGEN Imagen printer output (also use -Idir, where dir is the
X+ # location of imPcodes.h)
X
X! TERMFLAGS = -DTEK -DUNIXPLOT -DLATEX -DIMAGEN -I..
X! #TERMFLAGS = -DLATEX -DIMAGEN -I..
X
X # Your favorite tags program
X TAGS=etags
X***************
X*** 41,67 ****
X #TAGS=ctags
X
X OBJS = plot.o scanner.o parse.o command.o eval.o standard.o internal.o util.o\
X! graphics.o term.o misc.o version.o
X
X! SRC = plot.h command.c eval.c graphics.c internal.c misc.c \
X! parse.c plot.c scanner.c standard.c term.c util.c version.c
X
X! all: gnutex
X
X install: gnutex
X! install -c -s gnutex $(DESTDIR)gnutex
X install -c lasergnu $(DESTDIR)lasergnu
X install -m 444 doc/gnutex.1 $(MANDIR)/gnutex.l
X install -m 444 doc/lasergnu.1 $(MANDIR)/lasergnu.l
X
X gnutex: $(OBJS)
X! cc $(CFLAGS) $(OBJS) $(LIBS) -o gnutex
X
X term.o: term.c
X cc $(CFLAGS) $(TERMFLAGS) -c term.c
X
X $(OBJS): plot.h
X
X # Make a very simple demo plot
X demo:
X (cd doc/example; make)
X--- 50,92 ----
X #TAGS=ctags
X
X OBJS = plot.o scanner.o parse.o command.o eval.o standard.o internal.o util.o\
X! graphics.o term.o misc.o help.o version.o
X
X! SRC = plot.h Help/help.h command.c eval.c graphics.c internal.c misc.c \
X! parse.c plot.c scanner.c standard.c term.c util.c Help/help.c version.c
X
X! all: gnutex mail
X
X install: gnutex
X! install -c gnutex $(DESTDIR)gnutex
X install -c lasergnu $(DESTDIR)lasergnu
X install -m 444 doc/gnutex.1 $(MANDIR)/gnutex.l
X install -m 444 doc/lasergnu.1 $(MANDIR)/lasergnu.l
X+ install -m 444 -c gnutex.help $(HELPFILE)
X
X+ install-sysv: gnutex
X+ mv gnutex $(DESTDIR)
X+ cp lasergnu $(DESTDIR)
X+ cp doc/*.1 $(MANDIR)
X+ cp gnutex.help $(HELPFILE)
X+
X gnutex: $(OBJS)
X! cc $(CFLAGS) -O -s $(OBJS) $(LIBS) -o gnutex -lm
X
X term.o: term.c
X cc $(CFLAGS) $(TERMFLAGS) -c term.c
X
X+ command.o: command.c
X+ cc $(CFLAGS) $(COMMANDFLAGS) -c command.c
X+
X+ help.o: Help/help.c
X+ cc $(CFLAGS) -c Help/help.c
X+
X $(OBJS): plot.h
X
X+ mail:
X+ maildfk
X+
X # Make a very simple demo plot
X demo:
X (cd doc/example; make)
X***************
X*** 76,81 ****
X--- 101,107 ----
X
X clean:
X rm -f *.o *~ core
X+ (cd Help; make clean)
X
X spotless:
X rm -f *.o *~ core gnutex TAGS
Xdiff -cr ../gnutex.old/PATCHLEVEL ./PATCHLEVEL
X*** ../gnutex.old/PATCHLEVEL Fri Feb 10 12:16:04 1989
X--- ./PATCHLEVEL Wed Feb 1 11:24:36 1989
X***************
X*** 1 ****
X! 4
X--- 1 ----
X! 5
XOnly in ../gnutex.old: Patch3-rm
Xdiff -cr ../gnutex.old/Patch5-rm ./Patch5-rm
X*** ../gnutex.old/Patch5-rm Fri Feb 10 12:27:39 1989
X--- ./Patch5-rm Fri Feb 10 12:22:19 1989
X***************
X*** 0 ****
X--- 1,8 ----
X+ #!/bin/sh
X+ #
X+ # remove files from old versions that aren't used any more
X+
X+ rm -rf help/ vmshelp.csh Patch3-rm
X+
X+ # remove this file
X+ rm Patch5-rm
Xdiff -cr ../gnutex.old/README ./README
X*** ../gnutex.old/README Mon Dec 5 13:25:42 1988
X--- ./README Wed Feb 1 18:01:33 1989
X***************
X*** 6,13 ****
X generally tried to retain the style of the original and to modify as
X little as possible to make this possible.
X
X I have not tried compiling this for VMS, and only use the Latex and
X! tektronix drivers.
X
X Documentation is in
X gnutex.1 - man page for gnutex
X--- 6,16 ----
X generally tried to retain the style of the original and to modify as
X little as possible to make this possible.
X
X+ This version should compile successfully on Vaxes, Suns, Microvaxes,
X+ IBM PCs, and HP-UX (a System V box). It also may work on VMS.
X+
X I have not tried compiling this for VMS, and only use the Latex and
X! Tektronix drivers.
X
X Documentation is in
X gnutex.1 - man page for gnutex
X***************
X*** 37,42 ****
X--- 40,51 ----
X as long as you follow the usage statement given by the gnuplot authors
X in each file.
X
X+ THANKS:
X+ Thanks to many people who have pointed out bugs and made suggestions,
X+ including Bob Desinger, Paul E. McKenney, and J. D. McDonald; to
X+ bd@hp-sde.sde.hp.com, for the help-file code; and to the local users
X+ who put up with the newest bugs.
X+
X PATCHES:
X patch1: Enhancement to add "set format" command. See help/set-show/format.
X patch2: Small change to source so VMS compilers accept it.
X***************
X*** 43,48 ****
X--- 52,59 ----
X patch3: New manual written (see doc/). Several small but annoying bugs
X fixed. Note that start-up initialization file is no long ".gnuplot"
X but ".gnutex".
X+ patch4: Mostly changes to make it work on an IBM PC.
X+ patch5: Some bug fixes, System V support, Imagen support.
X
X David Kotz
X November 4, 1988
Xdiff -cr ../gnutex.old/command.c ./command.c
X*** ../gnutex.old/command.c Fri Feb 10 12:16:08 1989
X--- ./command.c Thu Feb 2 13:09:30 1989
X***************
X*** 21,26 ****
X--- 21,27 ----
X #include <stdio.h>
X #include <math.h>
X #include "plot.h"
X+ #include "help.h"
X
X #ifndef STDOUT
X #define STDOUT 1
X***************
X*** 62,69 ****
X char title_string[MAX_LINE_LEN] = "";
X char xlabel_string[MAX_LINE_LEN] = "";
X char ylabel_string[MAX_LINE_LEN] = "";
X! char xformat[MAX_ID_LEN] = "$%g$";
X! char yformat[MAX_ID_LEN] = "$%g$";
X int y_skip_factor = 0;
X double plot_width = 4; /* width in inches, for latex */
X double plot_height = 3; /* height in inches, for latex */
X--- 63,70 ----
X char title_string[MAX_LINE_LEN] = "";
X char xlabel_string[MAX_LINE_LEN] = "";
X char ylabel_string[MAX_LINE_LEN] = "";
X! char xformat[MAX_ID_LEN] = "";
X! char yformat[MAX_ID_LEN] = "";
X int y_skip_factor = 0;
X double plot_width = 4; /* width in inches, for latex */
X double plot_height = 3; /* height in inches, for latex */
X***************
X*** 93,99 ****
X
X struct curve_points plot[MAX_PLOTS];
X
X! static char help[80] = HELP;
X
X #ifdef MSDOS
X #include <process.h>
X--- 94,100 ----
X
X struct curve_points plot[MAX_PLOTS];
X
X! static char helpbuf[80];
X
X #ifdef MSDOS
X #include <process.h>
X***************
X*** 114,122 ****
X $DESCRIPTOR(line_desc,input_line);
X $DESCRIPTOR(null_desc,"");
X
X- $DESCRIPTOR(help_desc,help);
X- $DESCRIPTOR(helpfile_desc,"GNUPLOT$HELP");
X-
X struct dsc$descriptor_s *cmd_ptr;
X
X #endif
X--- 115,120 ----
X***************
X*** 256,277 ****
X define();
X else if (equals(c_token,"help") || equals(c_token,"?")) {
X c_token++;
X! len = sizeof(HELP)-1;
X! help[len] = '\0'; /* remove previous help arguments */
X while (!(END_OF_COMMAND)) {
X! help[len] = ' '; /* put blank between help segments */
X! copy_str(help+len+1,c_token++);
X! len = strlen(help);
X }
X! #ifdef vms
X! help_desc.dsc$w_length = len;
X! if ((vaxc$errno = lbr$output_help(lib$put_output,0,&help_desc,
X! &helpfile_desc,0,lib$get_input)) != SS$_NORMAL)
X! os_error("can't open GNUPLOT$HELP");
X! #else /* vms */
X! if (system(help))
X! os_error("can't spawn help");
X! #endif /* vms */
X screen_ok = FALSE;
X c_token++;
X }
X--- 254,286 ----
X define();
X else if (equals(c_token,"help") || equals(c_token,"?")) {
X c_token++;
X! len = 0;
X while (!(END_OF_COMMAND)) {
X! copy_str(helpbuf+len,c_token++);
X! len = strlen(helpbuf);
X! helpbuf[len++] = ' ';
X! helpbuf[len] = '\0';
X }
X! if (len > 0) {
X! helpbuf[len-1] = '\n';
X! lower_case(helpbuf);
X! } else
X! sprintf(helpbuf, "\n");
X! switch (help(helpbuf, HELPFILE)) {
X! case H_FOUND:
X! /* already printed the help info; do nothing */
X! break;
X! case H_NOTFOUND:
X! printf("Sorry, no help for %s", helpbuf);
X! break;
X! case H_ERROR:
X! perror(HELPFILE);
X! break;
X! default: /* defensive programming */
X! int_error("Impossible case in switch\n", NO_CARET);
X! break;
X! }
X!
X screen_ok = FALSE;
X c_token++;
X }
X***************
X*** 749,756 ****
X (*term_tbl[term].init)();
X term_init = TRUE;
X }
X! /* Below is a hack; no terminal but LATEX uses all these
X! * arguments, and calling this here in LATEX hardly 'clears'
X * the screen. (DFK 10/87)
X */
X (*term_tbl[term].graphics)(plot_width, plot_height,
X--- 758,765 ----
X (*term_tbl[term].init)();
X term_init = TRUE;
X }
X! /* Below is a hack; no terminals but LATEX and IMAGEN uses all
X! * these arguments, and calling this for them hardly 'clears'
X * the screen. (DFK 10/87)
X */
X (*term_tbl[term].graphics)(plot_width, plot_height,
X***************
X*** 966,971 ****
X--- 975,982 ----
X /* x coordinate */
X const_express(&a);
X x = real(&a);
X+ if (log_x) /* handle coords on logscale plot. PEM 01/17/89 */
X+ x = log10(x);
X
X if (!equals(c_token, ","))
X int_error("comma expected", c_token);
X***************
X*** 974,979 ****
X--- 985,992 ----
X /* y coordinate */
X const_express(&a);
X y = real(&a);
X+ if (log_y) /* handle coords on logscale plot. PEM 01/17/89 */
X+ y = log10(y);
X
X /* text */
X if (isstring(c_token))
XCommon subdirectories: ../gnutex.old/doc and ./doc
Xdiff -cr ../gnutex.old/gnutex.help ./gnutex.help
X*** ../gnutex.old/gnutex.help Fri Feb 10 12:24:38 1989
X--- ./gnutex.help Wed Feb 1 21:12:46 1989
X***************
X*** 0 ****
X--- 1,1068 ----
X+ ??
X+ ?
X+ GNUTEX is a command-driven interactive function plotting program.
X+ It is case sensitive (commands and function names written in lowercase
X+ are not the same as those written in CAPS). All command names may be
X+ abbreviated, as long as the abbreviation is not ambiguous.
X+
X+ Commands may extend over several input lines, by ending each line but
X+ the last with a backslash (\). The backslash must be the LAST
X+ character on each line. The effect is as if the backslash and newline
X+ were not there. That is, no white space is implied, nor is a comment
X+ terminated. Therefore, commenting out a continued line comments out
X+ the entire command.
X+
X+ Additional help is available for each of these topics:
X+ clear key plot shell
X+ comments label print start-up
X+ exit latex save substitution
X+ expressions load set user-defined
X+ ?continue
X+ Commands may extend over several input lines, by ending each line but
X+ the last with a backslash (\). The backslash must be the LAST
X+ character on each line. The effect is as if the backslash and newline
X+ were not there. That is, no white space is implied, nor is a comment
X+ terminated. Therefore, commenting out a continued line comments out
X+ the entire command.
X+ ?clear
X+ This command erases the current screen or output device as specified by
X+ 'set output'. This usually generates a formfeed on hardcopy devices.
X+ Use 'set terminal' to set the device type.
X+ ?comments
X+
X+ Comments:
X+ Comments are now supported: a # may appear in most places in a line
X+ and gnutex will ignore the rest of the line. It will not have this
X+ affect inside quotes, inside numbers (incl. complex numbers), inside
X+ command substitutions, etc. In short, it works anywhere it makes sense
X+ to work.
X+ ?exit
X+ ?quit
X+ 'exit', 'quit' and your computer's END-OF-FILE character will
X+ exit GNUTEX. All these commands will clear the output device
X+ (as the 'clear' command does) before exiting.
X+ ?expressions
X+ In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
X+ BASIC is valid. The precedence of these operators is determined by the
X+ specifications of the C programming language. White space (spaces and tabs)
X+ is ignored inside expressions.
X+
X+ Complex constants may be expressed as {real,imag}, where <real> and
X+ <imag> must be numerical constants. For example {3,2} represents
X+ 3 + 2i; {0,1} represents 'i' itself.
X+
X+ Additional help is available for each of these topics:
X+ functions operators
X+ ?functions
X+ ?expressions functions
X+ The functions in GNUTEX are the same as the corresponding functions in
X+ the UNIX math library, except that all functions accept integer, real,
X+ and complex arguments, unless otherwise noted. The BASIC sgn()
X+ function is also supported.
X+
X+ Additional help is available for each of these topics:
X+ abs asin besj1 ceil exp int real sinh tanh
X+ acos atan besy0 cos floor log sgn sqrt
X+ arg besj0 besy1 cosh imag log10 sin tan
X+ ?expressions functions abs
X+ ?abs
X+ This function returns the absolute value of its argument.
X+ The returned value is of the same type as the argument.
X+
X+ For complex arguments, abs(x) is defined as the length of x in the
X+ complex plane [i.e. sqrt(real(arg)**2 + imag(arg)**2) ].
X+ ?expressions functions acos
X+ ?acos
X+ This function returns the arc cosine (inverse cosine) of its argument. 'acos'
X+ returns its argument in radians.
X+ ?expressions functions arg
X+ ?arg
X+ This function returns the phase of a complex number, in radians.
X+ ?expressions functions asin
X+ ?asin
X+ This function returns the arc sin (inverse sin) of its argument. 'asin'
X+ returns its argument in radians.
X+ ?expressions functions atan
X+ ?atan
X+ This function returns the arc tangent (inverse tangent) of its argument.
X+ 'atan' returns its argument in radians.
X+ ?expressions functions besj0
X+ ?besj0
X+ This function returns the j0th Bessel function of its argument. 'besj0'
X+ expects its argument to be in radians.
X+ ?expressions functions besj1
X+ ?besj1
X+ This function returns the j1st Bessel function of its argument. 'besj1'
X+ expects its argument to be in radians.
X+ ?expressions functions besy0
X+ ?besy0
X+ This function returns the y0th Bessel function of its argument. 'besy0'
X+ expects its argument to be in radians.
X+ ?expressions functions besy1
X+ ?besy1
X+ This function returns the y1st Bessel function of its argument. 'besy1'
X+ expects its argument to be in radians.
X+ ?expressions functions ceil
X+ ?ceil
X+ This function returns the largest integer not less than its argument.
X+ For complex numbers, 'ceil' returns the largest integer not less than
X+ the real part of its argument.
X+ ?expressions functions cos
X+ ?cos
X+ This function returns the cosine of its argument. 'cos' expects its argument
X+ to be in radians.
X+ ?expressions functions cosh
X+ ?cosh
X+ This function returns the hyperbolic cosine of its argument. 'cosh' expects
X+ its argument to be in radians.
X+ ?expressions functions exp
X+ ?exp
X+ This function returns the exponential function of its argument (e raised to
X+ the power of its argument).
X+ ?expressions functions floor
X+ ?floor
X+ This function returns the smallest integer not greater than its argument.
X+ For complex numbers, 'floor' returns the smallest integer not greater than
X+ the real part of its argument.
X+ ?expressions functions imag
X+ ?imag
X+ This function returns the imaginary part of its argument as a real number.
X+ ?expressions functions int
X+ ?int
X+ This function returns the integer part of its argument, truncated toward
X+ zero.
X+ ?expressions functions log
X+ ?log
X+ This function returns the natural logarithm (base e) of its argument.
X+ ?expressions functions log10
X+ ?log10
X+ This function returns the logarithm (base 10) of its argument.
X+ ?expressions functions real
X+ ?real
X+ This function returns the real part of its argument.
X+ ?expressions functions sgn
X+ ?sgn
X+ This function returns 1 if its argument is positive, -1 if its
X+ argument is negative, and 0 if its argument is 0. If the argument
X+ is a complex value, the imaginary component is ignored.
X+ ?expressions functions sin
X+ ?sin
X+ This function returns the sine of its argument. 'sin' expects its argument
X+ to be in radians.
X+ ?expressions functions sinh
X+ ?sinh
X+ This function returns the hyperbolic sine of its argument. 'sinh' expects
X+ its argument to be in radians.
X+ ?expressions functions sqrt
X+ ?sqrt
X+ This function returns the square root of its argument.
X+ ?expressions functions tan
X+ ?tan
X+ This function returns the tangent of its argument. 'tan' expects its argument
X+ to be in radians.
X+ ?expressions functions tanh
X+ ?tanh
X+ This function returns the hyperbolic tangent of its argument. 'tanh' expects
X+ its argument to be in radians.
X+ ?operators
X+ ?expressions operators
X+ The operators in GNUTEX are the same as the corresponding operators
X+ in the C programming language, except that all operators accept integer, real,
X+ and complex arguments, unless otherwise noted. The FORTRAN **
X+ (exponentiation) operator is also supported.
X+
X+ Parentheses may be used to change order of evaluation.
X+
X+ Additional help is available for each of these topics:
X+ binary unary
X+ ?expressions operators binary
X+ ?binary
X+ The following is a list of all the binary operators and their usage:
X+
X+ Symbol Example Explanation
X+ ** a**b exponentiation
X+ * a*b multiplication
X+ / a/b division
X+ % a%b modulo
X+ + a+b addition
X+ - a-b subtraction
X+ == a==b equality
X+ != a!=b inequality
X+ & a&b bitwise and
X+ ^ a^b bitwise exclusive or
X+ | a|b bitwise inclusive or
X+ && a&&b logical and
X+ || a||b logical or
X+ ?: a?b:c terniary operation
X+
X+ The terniary operator evaluates its first argument (a). If it is true
X+ (non-zero) the second argument (b) is returned, otherwise the
X+ third argument (c) is returned.
X+ ?expressions operators unary
X+ ?unary
X+ The following is a list of all the unary operators and their usage:
X+
X+ Symbol Example Explantion
X+ - -a unary minus
X+ ~ ~a one's complement
X+ ! !a logical negation
X+ ?key
X+ LATEX ONLY:
X+
X+ Plotting a Key:
X+ If you wish a key describing the plots to be made, use the "key" command:
X+ key x,y "description1" w <style1> [, "description2" w <style2>"] ...
X+
X+ The key command looks a lot like a plot command. The coordinates x,y
X+ specify the location of the key on the plot (see below). The key is
X+ drawn as a sequence lines, with one plot described on each line. On
X+ the left-hand side of each line is a representation that attempts to
X+ mimic the way the curve is plotted (eg, a bunch of dots for a line,
X+ the point symbol for a point, etc). On the right side of each line is
X+ the text "description" given in the command. The lines are vertically
X+ arranged so an imaginary straight line divides the left- and
X+ right-hand sides of the key. It is the x-coordinate of this line that
X+ you specify with the x in the key command; the y in the key command is
X+ the bottom of the key.
X+
X+ For example, the plot command
X+ plot "foo" w points, "bar" w lines, "funky" w linespoints
X+ followed by
X+ key 5,5 "This is foo" w points, "This is bar" w lines, \
X+ "This is funky" w linespoints
X+ would give us a key that looks (roughly) like this:
X+ <> This is foo
X+ ..... This is bar
X+ ...+.. This is funky
X+ (The <> is a diamond).
X+
X+ Any styles may be used in the key entries, including user-defined
X+ styles. For the points and linespoints styles, the point type plotted
X+ is determined in the same way as in the plot command, so your key
X+ entries should be in the same order as in the plot command. Note that
X+ a key entry with an empty (ie "") description will not be included in
X+ the key, but may be included to affect the point-type determination.
X+ For example, if you didn't want to key the "foo" curve above, but you
X+ wanted "funky" to look right, the key command is
X+ key 5,5 "" w points, "This is bar" w lines, \
X+ "This is funky" w linespoints
X+ and gives us a key that looks (roughly) like this:
X+ ..... This is bar
X+ ...+.. This is funky
X+
X+ The key is fairly rough at this time and I may find ways to make it
X+ look better. Suggestions welcome.
X+ ?label
X+ IMAGEN and LATEX ONLY:
X+
X+ Arbitrary labels may be placed on the most recent plot, using the new
X+ "label" command. The syntax is
X+ label x,y "text"
X+ where x,y is some coordinate in your plot's coordinate system (the
X+ commas are important). The text is any arbitrary LaTeX input, and will
X+ be processed in LR mode. The text is centered at the point x,y. The
X+ label command should follow the plot command. Any number of labels may
X+ be placed.
X+
X+ If you want to adjust the way the label is positioned with respect to
X+ the point x,y, add another parameter:
X+ label x,y "text" pos
X+ where pos is one of r,l,t,b,lt,lb,rt,rb indicating that the text
X+ should be placed so that the point is at the right center, left
X+ center, top center, bottom center, left top corner, etc.
X+
X+ An arrow can be drawn out from the point simply by giving its
X+ length in problem coordinates, after the pos:
X+ label x,y "text" pos length
X+ The length is defined to be the HORIZONTAL extent of the arrow, unless
X+ the arrow is vertical, in which case it is the vertical extent of the
X+ arrow. The arrow is drawn AWAY FROM the text; for example, if pos is
X+ lt, then away is defined to be up and to the left. If it is b, away is
X+ defined to be down. This allows for eight different directions of
X+ arrows.
X+
X+ Further control over the slope of the arrow can be gained by
X+ specifying exactly the slope you want. You should read about vectors
X+ on page 198 in the LaTeX manual. The command looks like
X+ label x,y "text" pos length, h_slope, v_slope
X+ (the commas are important). The h_slope and v_slope are integers in
X+ the range -4 to 4, which specify the slope of the line (run, rise).
X+ A horizontal line is 1,0, vertical is 0,1. The two numbers may not
X+ have a common divisor other than +1 or -1.
X+
X+ Labels outside of the plotted boundaries are permitted but may
X+ interfere with axes labels or other text; use at your own risk.
X+ ?latex
X+ Documentation for the LATEX extensions to gnuplot (gnutex) (updated 11/4/88):
X+
X+ To run gnutex, type
X+ /usr/local/bin/gnutex
X+ See /usr/local/public/doc/gnutex/* for examples and help.
X+
X+ To use the LaTeX facilities of gnutex, the first command to gnutex
X+ should be
X+ set terminal latex
X+ and the output of latex should be directed to a file, for example,
X+ set output "plot.tex"
X+ This may be anything you like but it should have a ".tex" extension,
X+ of course. Then the size of the plot should be given, eg
X+ set size 5, 4
X+ tells gnutex to use a 5 inch wide by 4 inch high box for the plot.
X+ This is the size of the actual plotting area; labels (see below) will
X+ extend outside of this size.
X+
X+ When finished, the file will contain all of the plots you have
X+ specified (you probably only want one plot per file). This file can
X+ then be used in a LaTeX document, for example,
X+ \begin {figure}
X+ \input{plot}
X+ \end {figure}
X+ This puts the plot into a figure.
X+
X+ Other than the above, gnutex acts much as gnuplot used to do. The plot
X+ command will do its usual thing, but since TeX cannot draw straight
X+ lines with arbitrary slopes, and runs out of memory if lines are
X+ approximated by a series of many tiny dots, lines are drawn as a
X+ series of dots. The usual symbols are plotted for the "with points"
X+ linestyle. User-defined styles are described below.
X+
X+ NOTE: Linestyles may no longer be abbreviated, for example, "p" for
X+ "points", "l" for "lines", and "linesp" for "linespoints". The full
X+ word must be written out.
X+
X+ The plot is also labeled in a variety of ways. The ticks on the x
X+ and y axes are labeled with the appropriate numbers. The axes may be
X+ labeled and a title provided for the plot with new 'set' commands.
X+ The labels in effect at the time of the "plot" command are used, so
X+ they should be set before the plot. Once set, they retain their values
X+ until explicitly changed. For example,
X+ set title "This is the title of the plot"
X+ set xlabel "This is the x axis"
X+ set ylabel "This is the y axis"
X+ will label the top, bottom, and left sides of the plot, respectively.
X+ These can be more sophisticated, for example,
X+ set title "This is a very long title\\because it has\\three lines"
X+ set xlabel "This is the $x$ axis\\with more than two\\lines in the label"
X+ set ylabel "This is a longer\\version of\\the $y$ axis"
X+ Here there are line breaks, and math mode is used to make the 'x' and
X+ 'y' look like variables. The line breaks are particularly useful for
X+ the y axis label.
X+
X+ If the ylabel is not coming out quite right (too close to the plot),
X+ its position may be adjusted with a second parameter, such as
X+ set ylabel "This is the y axis" 2
X+ This will slide the y label about 2 characters further left (away from
X+ the plot). Positive and negative integers are allowed.
X+
X+ Sometimes the x- or y-axis numbers really don't mean anything, and you
X+ would rather not have the numbers and tics printed on the axis. If
X+ this is the case, insert a
X+ set noxtics
X+ and/or
X+ set noytics
X+ before the plot command. To turn them back on use
X+ set xtics
X+ set ytics
X+
X+ The tics on both axes are labelled with a format "$%g$", which uses
X+ the general-purpose printf format and math mode to format the number.
X+ If you want to change this, use the "set format" command:
X+ set format "format-string"
X+ set format <axis> "format-string"
X+ where <axis> is 'x', 'y', or 'xy'. Using 'xy' is the same as using
X+ nothing at all, as in the first form. This sets the format string to
X+ be used for the given axis (axes). For example, you may prefer
X+ "$%3.1f$" (note that math mode almost always looks better, but is not
X+ necessary). Or maybe "$%3.0f \mu$sec", or "$%5.2 \cdot 10^{-3}$". Use
X+ your imagination, but restrict yourself to the f, e, and g formats, as
X+ the number is a double-precision number, and the other formats
X+ (d,o,x,u,c,s) will not work correctly.
X+
X+
X+ Plotting a Key:
X+ If you wish a key describing the plots to be made, use the "key" command:
X+ key x,y "description1" w <style1> [, "description2" w <style2>"] ...
X+
X+ The key command looks a lot like a plot command. The coordinates x,y
X+ specify the location of the key on the plot (see below). The key is
X+ drawn as a sequence of lines, with one plot described on each line. On
X+ the left-hand side of each line is a representation that attempts to
X+ mimic the way the curve is plotted (eg, a bunch of dots for a line,
X+ the point symbol for a point, etc). On the right side of each line is
X+ the text "description" given in the command. The lines are vertically
X+ arranged so an imaginary straight line divides the left- and
X+ right-hand sides of the key. It is the x-coordinate of this line that
X+ you specify with the x in the key command; the y in the key command is
X+ the bottom of the key.
X+
X+ For example, the plot command
X+ plot "foo" w points, "bar" w lines, "funky" w linespoints
X+ followed by
X+ key 5,5 "This is foo" w points, "This is bar" w lines, \
X+ "This is funky" w linespoints
X+ would give us a key that looks (roughly) like this:
X+ <> This is foo
X+ ..... This is bar
X+ ...+.. This is funky
X+ (The <> is a diamond).
X+
X+ Any styles may be used in the key entries, including user-defined
X+ styles. For the points and linespoints styles, the point type plotted
X+ is determined in the same way as in the plot command, so your key
X+ entries should be in the same order as in the plot command. Note that
X+ a key entry with an empty (ie "") description will not be included in
X+ the key, but may be included to affect the point-type determination.
X+ For example, if you didn't want to key the "foo" curve above, but you
X+ wanted "funky" to look right, the key command is
X+ key 5,5 "" w points, "This is bar" w lines, \
X+ "This is funky" w linespoints
X+ and gives us a key that looks (roughly) like this:
X+ ..... This is bar
X+ ...+.. This is funky
X+
X+ The key is fairly rough at this time and I may find ways to make it
X+ look better. Suggestions welcome.
X+
X+
X+ User-defined linestyles:
X+ If you find the "dot" approximation to lines to be inadequate, or
X+ desire your different curves on the same plot to have different
X+ styles, then you can define your own style (up to 16 may be defined).
X+ A style may be defined at any time with a command of the form
X+ set style <name> <point>
X+ or
X+ set style <name> <spacing> <dot>...
X+ or
X+ set style <name> <point> <spacing> <dot>...
X+
X+ The first form defines a style similar to "points", the second similar
X+ to "lines" and the third to "linespoints". The <name> is any
X+ identifier, just as with user-defined variables and functions (it may
X+ not be lines, points, impulses, or linespoints). To use the style,
X+ simply use the <name> where you would use any of the standard
X+ linestyle names: "with <name>", "set data style <name>", or "set
X+ function style <name>".
X+
X+ The <point> is a quoted string of LaTeX source which describes text to
X+ be plotted at each point. Picture-mode and math-mode commands are the
X+ most useful. For example, "\circle*{100}" draws a disk 1pt in
X+ diameter at each data point (the units of picture coordinates in use
X+ are 1/100 point). "$\Diamond$" produces a large diamond symbol.
X+
X+ The <spacing> and <dot> arguments define a line in terms of a sequence
X+ of "dots" to be output every <spacing> points along the line to be
X+ plotted. <spacing> is a real number whose units are points. Each dot
X+ (up to 5 dots are allowed) is a quoted string of LaTeX text, as with
X+ the point above. The dots are plotted in rotation along the whole
X+ curve.
X+
X+ Thus, to simulate a linespoints linestyle with alternating big and
X+ little dots every 4 points the curve but to use a plus sign at each
X+ data point,
X+ set style mine "$+$" 4 "\circle*{100}" "\circle*{200}"
X+
X+ The default style is as if
X+ set style lines 2 "\circle*{1}"
X+ set style linespoints <varies> 2 "\circle*{1}"
X+ Had been executed. (The smallest circle that will be drawn is about
X+ 100 units; smaller sizes as this one will use that smallest size).
X+ Linespoints is special in that its points vary with each curve on the
X+ plot, as with classic gnutex. This is not possible to embody in a
X+ single user-defined linestyle.
X+
X+ Labeling Curves:
X+ Arbitrary labels may be placed on the most recent plot, using the new
X+ "label" command. The syntax is
X+ label x,y "text"
X+ where x,y is some coordinate in your plot's coordinate system (the
X+ commas are important). The text is any arbitrary LaTeX input, any will
X+ be processed in LR mode. The text is centered at the point x,y. The
X+ label command should follow the plot command. Any number of labels may
X+ be placed.
X+
X+ If you want to adjust the way the label is positioned with respect to
X+ the point x,y, add another parameter:
X+ label x,y "text" pos
X+ where pos is one of r,l,t,b,lt,lb,rt,rb indicating that the text
X+ should be placed so that the point is at the right center, left
X+ center, top center, bottom center, left top corner, etc.
X+
X+ An arrow can be drawn out from the point simply by giving its
X+ length in problem coordinates, after the pos:
X+ label x,y "text" pos length
X+ The length is defined to be the HORIZONTAL extent of the arrow, unless
X+ the arrow is vertical, in which case it is the vertical extent of the
X+ arrow. The arrow is drawn AWAY FROM the text; for example, if pos is
X+ lt, then away is defined to be up and to the left. If it is b, away is
X+ defined to be down. This allows for eight different directions of
X+ arrows.
X+
X+ Further control over the slope of the arrow can be gained by
X+ specifying exactly the slope you want. You should read about vectors
X+ on page 198 in the LaTeX manual. The command looks like
X+ label x,y "text" pos length, h_slope, v_slope
X+ (the commas are important). The h_slope and v_slope are integers in
X+ the range -4 to 4, which specify the slope of the line (run, rise).
X+ A horizontal line is 1,0, vertical is 0,1. The two numbers may not
X+ have a common divisor other than +1 or -1.
X+
X+ Labels outside of the plotted boundaries are permitted but may
X+ interfere with axes labels or other text; use at your own risk.
X+
X+ Other
X+ -----
X+
X+ Gnutex normally clips (actually, does not plot at all) data points
X+ that fall within but too close to the boundaries (this is so the large
X+ symbols used for points will not extend outside the boundary lines).
X+ With the user-defined styles it is often desirable to make smaller
X+ points, and thus points near the boundaries may be plotted. To turn
X+ off clipping, use
X+ set noclip
X+ To turn it back on, use
X+ set clip
X+ The default is 'clip'. Without clipping you may have points near the
X+ boundaries that look bad; try adjusting the x and y ranges.
X+
X+ Comments:
X+ Comments are now supported: a # may appear in most places in a line
X+ and gnutex will ignore the rest of the line. It will not have this
X+ affect inside quotes, inside numbers (incl. complex numbers), inside
X+ command substitutions, etc. In short, it works anywhere it makes sense
X+ to work.
X+
X+ Please send bug reports and suggestions to dfk@cs.duke.edu.
X+ ?load
X+ This command executes each line of the specified input file
X+ as if it had been typed in interactively. Files created by the 'save'
X+ command can later be 'load'ed. Any text file containing valid commands
X+ can be created and then executed by the 'load' command. Files being
X+ 'load'ed may themselves contain 'load' commands.
X+
X+ The 'load' command must be the last command on the line.
X+
X+ Syntax: load <input-file>
X+
X+ The name of the input file must be enclosed in quotes.
X+ ?plot
X+ The 'plot' command is the primary command of the program. It displays
X+ functions and data in many, many ways. The full syntax of this
X+ command is:
X+
X+ plot {ranges} <function> {style} {, <function> {style}...}
X+
X+ Where <function> is either a mathematical expression or the name of a
X+ data file enclosed in quotes. User-defined functions and variables may also
X+ be defined here.
X+
X+ Curly braces {,} denote optional items.
X+
X+ A 'plot' command can be as simple as
X+
X+ plot sin(x)
X+
X+ or as complex as (!)
X+
X+ plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points
X+
X+ Additional help is available for each of these topics:
X+ data-file ranges style
X+ ?plot data-file
X+ ?data-file
X+ ?data
X+ Discrete data contained in a file can displayed by specifying the
X+ name of the data file (enclosed in quotes) on the 'plot' command line.
X+
X+ Data files should contain one data point per line. A data point may be
X+ specified either as an X and Y value separated by blank space, or as
X+ just the Y value, in which case the program will use the number of the
X+ coordinate as the X value. Coordinate numbers starts at 0 and are
X+ incremented for each data point read. Blank lines and lines beginning
X+ with ! or # will be treated as comments and ignored.
X+
X+
X+ This example compares the data in the file population.dat to a theoretical
X+ curve:
X+ pop(x) = 103*exp((1965-x)/10)
X+ plot [1960:1990] 'population.dat', pop(x)
X+
X+ The file population.dat might contain:
X+
X+ ! Gnu population in Antarctica since 1965
X+ 1965 103
X+ 1970 55
X+ 1975 34
X+ 1980 24
X+ 1985 10
X+ ?plot ranges
X+ ?ranges
X+ ?range
X+ These two options specify the region of the plot which will be displayed.
X+
X+ Ranges may be provided on the 'plot' command line as synonyms for the
X+ 'set xrange' and 'set yrange' commands.
X+
X+ Syntax: [{dummy-var =} {xmin : xmax}] { [{ymin : ymax}] }
X+
X+ Where dummy-var is the independent variable ('x' is used by default) and
X+ the min and max terms can be expressions or constants.
X+
X+ Both the min and max terms are optional. The ':' is also optional if
X+ neither a min nor a max term is specified. This allows '[]' to be used
X+ as a null range specification.
X+
X+ Specifying a Y range turns autoscaling OFF.
X+
X+ Examples:
X+
X+ plot cos(x) ; use current ranges
X+ plot [-10:30] sin(pi*x)/(pi*x) ; set xrange only
X+ plot [t = -10 :30] sin(pi*t)/(pi*t) ; same, but use t as dummy-var
X+ plot [-pi:pi] [-3:3] tan(x), 1/x ; set y and xranges
X+ plot [] [-2:sin(5)*-8] sin(x)**besj0(x) ; set only yrange
X+ plot [:200] [-pi:] exp(sin(x)) ; set xmax and ymin only
X+ ?plot style
X+ ?style
X+ Plots may be displayed in one of these styles: 'lines', 'points',
X+ 'linespoints', 'impulses', or 'dots'. The 'lines' style connects
X+ adjacent points with lines. The 'points' style displays a small
X+ symbol at each point. The 'linespoints' style is a combination of the
X+ previous two styles. The 'impulses' style displays a vertical line
X+ from the X axis to each point. The 'dots' style is like the 'points'
X+ style except a very tiny dot is plotted at each point, and the symbol
X+ does not vary from plot to plot. This is useful for plotting very many
X+ points to get a feel for the distribution. In addition, for LaTeX
X+ output only, there are user-defined styles (see the 'set style'
X+ command in 'user-styles').
X+
X+ Default styles are chosen with the 'set function style' and 'set data style'
X+ commands.
X+
X+ Syntax: with <style>
X+
X+ Where <style> is one of 'lines', 'points', 'linespoints', 'impulses',
X+ 'dots', or a user-defined style. These keywords may NOT be
X+ abbreviated.
X+
X+ Examples: Displays:
X+ plot sin(x) with impulses ; sin(x) with impulses
X+ plot [-9:30] sin(x) w points, cos(x) ; sin(x) with points, cos(x) default
X+ plot [] [-2:5] tan(x), "data.1" with l ; tan(x) default, "data.1" with lines
X+ plot "leastsq.dat" w i ; "leastsq.dat" with impulses
X+ ?print
X+ This command prints the value of <expression>.
X+
X+ Syntax: print <expression>
X+
X+ See 'expressions'.
X+ ?save
X+ This command saves either user-defined functions, variables, or both
X+ to the specified file.
X+
X+ Syntax: save {option} <filename>
X+
X+ Where <option> is either 'functions' or 'variables'. If no option
X+ is used GNUTEX saves both functions and variables.
X+
X+ 'save'd files are written in text format and may be read by the
X+ 'load' command.
X+
X+ The filename must be enclose in quotes.
X+ ?set
X+ ?show
X+ The 'set' command sets LOTS of options.
X+
X+ The 'show' command shows their settings. 'show all' shows all the settings.
X+
X+ Additional help is available for each of these topics:
X+ autoscale logscale style variables ylabel
X+ clip output terminal xlabel yrange
X+ format samples title xrange ytics
X+ functions size user-styles xtics zero
X+ ?set autoscale
X+ ?show autoscale
X+ ?autoscale
X+ Autoscaling is the default for both the x and y axes. If y
X+ autoscaling is on, the y axis is automatically scaled to fit the range
X+ of the function or data being plotted. If x autoscaling is on, the x
X+ range is scaled to the data file(s) being plotted; any functions
X+ plotted on the same curve will use the same range. If only functions
X+ are plotted, the current x range is used.
X+
X+ If autoscaling is not on for an axis, the current range for that axis
X+ is used. The current range is the range used for the last plot
X+ command, or defined by the 'set xrange' and 'set yrange' commands, or
X+ [-10:10] initially.
X+ The syntax is
X+ set autoscale [{axes}]
X+ set noautoscale [{axes}]
X+ show autoscale
X+
X+ The optional {axes} parameter specifies the axes affected by the
X+ command. If {axes} is 'x' or 'y', the command affects the x or y axis,
X+ respectively. If {axes} is 'xy', 'yx', or absent, the command affects
X+ both axes.
X+ ?set clip
X+ ?show clip
X+ ?clip
X+ Gnutex normally clips (actually, does not plot at all) data points
X+ that fall within but too close to the boundaries (this is so the large
X+ symbols used for points will not extend outside the boundary lines).
X+ With the user-defined styles of Latex it is often desirable to make
X+ smaller points, and thus points near the boundaries may be plotted. To
X+ turn off clipping, use
X+ set noclip
X+ To turn it back on, use
X+ set clip
X+ The default is 'clip'. Without clipping you may have points near the
X+ boundaries that look bad; try adjusting the x and y ranges. Indeed,
X+ for some terminal types this may cause errors.
X+
X+ ?set format
X+ ?show format
X+ ?format
X+ IMAGEN and LATEX ONLY:
X+
X+ The format of the tic-mark labels may be set with the "set format"
X+ command. The default format used for both axes is "$%g$", but other
X+ formats such as "%.2f" or "$%3.0f \mu$sec" are often desirable.
X+ Anything accepted by printf when given a DOUBLE-PRECISION number, and
X+ then accepted by LaTeX in LR mode, will work. In particular, the
X+ formats f, e, and g will work, and the d, o, x, c, s, and u formats
X+ will not work.
X+
X+ Syntax: set format <axes> "format-string"
X+ show format
X+
X+ Where <axes> is either 'x', 'y', 'xy', or nothing (which is the same
X+ as 'xy'). The length of the string representing a ticmark (after
X+ formatting with printf) is restricted to 100 characters.
X+ ?show functions
X+ The 'show functions' command lists all user-defined functions and their
X+ definitions.
X+
X+ Syntax: show functions
X+ ?set logscale
X+ ?show logscale
X+ ?logscale
X+ Log scaling may be set on the X and/or Y axis.
X+
X+ Syntax: set logscale <axes>
X+ set nologscale
X+ show logscale
X+
X+ Where <axes> is either 'x', 'y', or 'xy'.
X+ ?set output
X+ ?show output
X+ ?output
X+ By default, plots are displayed to the standard output. The 'set output'
X+ command redirects the displays to the specified file or device.
X+
X+ Syntax: set output {filename}
X+ show output
X+
X+ The filename must be enclosed in quotes. If the filename is omitted, output
X+ will be sent to the standard output.
X+ ?set samples
X+ ?show samples
X+ ?samples
X+ The sampling rates of functions may be changed by the 'set samples'
X+ command. By default, sampling is set to 160 points. A higher sampling
X+ rate will produce more accurate plots, but will take longer. In generating
X+ plots, GNUTEX will use either the sampling rate set or the resolution of
X+ the current output device, whichever is smaller.
X+
X+ Syntax: set samples <expression>
X+ show samples
X+ ?set size
X+ ?show size
X+ ?size
X+ IMAGEN and LATEX ONLY:
X+
X+ The 'set size' command will set the size of the plot, in inches.
X+
X+ For example,
X+
X+ set size 5, 4
X+
X+ tells gnutex to use a 5 inch wide by 4 inch high box for the plot.
X+ This is the size of the actual plotting area; labels (see the 'set
X+ xlabel', 'set ylabel', and 'set title' commands) will extend outside
X+ of this size.
X+ ?set style
X+ ?show style
X+ ?style
X+ Plots may be displayed in one of these styles: 'lines', 'points',
X+ 'linespoints', 'impulses', or 'dots'. The 'lines' style connects
X+ adjacent points with lines. The 'points' style displays a small
X+ symbol at each point. The 'linespoints' style is a combination of the
X+ previous two styles. The 'impulses' style displays a vertical line
X+ from the X axis to each point. The 'dots' style is like the 'points'
X+ style except a very tiny dot is plotted at each point, and the symbol
X+ does not vary from plot to plot. This is useful for plotting very many
X+ points to get a feel for the distribution. In addition, for LaTeX
X+ output only, there are user-defined styles (see the 'set style'
X+ command in 'user-styles').
X+
X+ Default styles are chosen with the 'set function style' and 'set data
X+ style' commands.
X+
X+ Syntax: set function style <style>
X+ set data style <style>
X+ show function style
X+ show data style
X+
X+ Where <style> is one of 'lines', 'points', 'linespoints', 'impulses',
X+ 'dots', or a user-defined style. These keywords may NOT be
X+ abbreviated.
X+
X+ ?set terminal
X+ ?show terminal
X+ ?terminal
X+ GNUTEX supports many different graphics devices. Use the 'set terminal'
X+ command to select the type of device for which GNUTEX will produce output.
X+
X+ Syntax: set terminal {terminal-type}
X+ show terminal
X+
X+ If <terminal-type> is omitted, the program will list the available terminal
X+ types. <terminal-type> may be abbreviated.
X+
X+ Use 'set output' to redirect this output to a file or device.
X+ ?set title
X+ ?show title
X+ ?title
X+ The plot is labeled in a variety of ways. A title may be provided for
X+ the plot with 'set title' commands. The title in effect at the time
X+ of the "plot" command is used, so it should be set before the plot.
X+ Once set, it retains its values until explicitly changed.
X+
X+ For example,
X+
X+ set title "This is the title"
X+
X+ When not in latex, the title shows up in the upper-left-hand corner of
X+ the plot, whenever the plot is being labeled.
X+
X+ With Latex, this may be more complex:
X+ set title "This is a very long title\\because it has\\three lines"
X+ ?set user-styles
X+ ?show user-styles
X+ ?user-styles
X+ LATEX ONLY:
X+
X+ If you find the "dot" approximation to lines to be inadequate, or
X+ desire your different curves on the same plot to have different
X+ styles, then you can define your own style (up to 16 may be defined).
X+ A style may be defined at any time with a command of the form
X+ set style <name> <point>
X+ or
X+ set style <name> <spacing> <dot>...
X+ or
X+ set style <name> <point> <spacing> <dot>...
X+
X+ The first form defines a style similar to "points", the second similar
X+ to "lines" and the third to "linespoints". The <name> is any
X+ identifier, just as with user-defined variables and functions (it may
X+ not be lines, points, impulses, linespoints, or dots). To use the style,
X+ simply use the <name> where you would use any of the standard
X+ linestyle names: "with <name>", "set data style <name>", or "set
X+ function style <name>".
X+
X+ The <point> is a quoted string of LaTeX source which describes text to
X+ be plotted at each point. Picture-mode and math-mode commands are the
X+ most useful. For example, "\circle*{100}" draws a disk 1pt in
X+ diameter at each data point (the units of picture coordinates in use
X+ are 1/100 point). "$\Diamond$" produces a large diamond symbol.
X+
X+ The <spacing> and <dot> arguments define a line in terms of a sequence
X+ of "dots" to be output every <spacing> points along the line to be
X+ plotted. <spacing> is a real number whose units are points. Each dot
X+ (up to 5 dots are allowed) is a quoted string of LaTeX text, as with
X+ the point above. The dots are plotted in rotation along the whole
X+ curve.
X+
X+ Thus, to simulate a linespoints linestyle with alternating big and
X+ little dots every 4 points along the curve but to use a plus sign at
X+ each data point,
X+ set style mine "$+$" 4 "\circle*{100}" "\circle*{200}"
X+
X+ The default style is as if
X+ set style lines 2 "\circle*{1}"
X+ set style linespoints <varies> 2 "\circle*{1}"
X+ Had been executed. (The smallest circle that will be drawn is about
X+ 100 units; smaller sizes as this one will use that smallest size).
X+ Linespoints is special in that its points vary with each curve on the
X+ plot, as with classic gnuplot. This is not possible to embody in a
X+ single user-defined linestyle.
X+
X+ ?show variables
X+ ?variables
X+ The 'show variables' command lists all user-defined variables and their
X+ values.
X+
X+ Syntax: show variables
X+ ?set xlabel
X+ ?show xlabel
X+ ?xlabel
X+ IMAGEN and LATEX ONLY:
X+
X+ The plot is labeled in a variety of ways. The ticks on the x and y
X+ axes are labeled with the appropriate numbers. The axes may be labeled
X+ and a title provided for the plot with 'set' commands. The labels
X+ in effect at the time of the "plot" command are used, so they should
X+ be set before the plot. Once set, they retain their values until
X+ explicitly changed.
X+
X+ To label the x-axis, for example,
X+
X+ set xlabel "This is the x axis"
X+
X+ This may be more complex:
X+ set xlabel "This is the $x$ axis\\with more than two\\lines in the label"
X+ Here there are line breaks, and math mode is used to make the 'x' look
X+ like a variable.
X+ ?set xrange
X+ ?show xrange
X+ ?xrange
X+ The 'set xrange' command sets the horizontal range of values which will
X+ be displayed.
X+
X+ This range may also be specified on the 'plot' command line.
X+
X+ Syntax: set xrange [{xmin : xmax}]
X+
X+ Where <xmin> and <xmax> terms are expressions or constants.
X+
X+ Both the <xmin> and <xmax> terms are optional.
X+ ?set ylabel
X+ ?show ylabel
X+ ?ylabel
X+ IMAGEN and LATEX ONLY:
X+
X+ The plot is labeled in a variety of ways. The ticks on the x and y
X+ axes are labeled with the appropriate numbers. The axes may be labeled
X+ and a title provided for the plot with new 'set' commands. The labels
X+ in effect at the time of the "plot" command are used, so they should
X+ be set before the plot. Once set, they retain their values until
X+ explicitly changed.
X+
X+ To label the y-axis, for example,
X+
X+ set ylabel "This is the y axis"
X+
X+ This may be more complex:
X+ set ylabel "This is a longer\\version of\\the $y$ axis"
X+ Here there are line breaks, and math mode is used to make the 'y' look
X+ like a variable.
X+
X+ If the ylabel is not coming out quite right (too close to the plot),
X+ its position may be adjusted with a second parameter, such as
X+ set ylabel "This is the y axis" 2
X+ This will slide the y label about 2 characters further left (away from
X+ the plot). Positive and negative integers are allowed.
X+ ?set yrange
X+ ?show yrange
X+ ?yrange
X+ The 'set yrange' command sets the vertical range of values which will
X+ be displayed. This command turns autoscaling OFF.
X+
X+ This range may also be specified on the 'plot' command line.
X+
X+ Syntax: set yrange [{ymin : ymax}]
X+
X+ Where <ymin> and <ymax> terms are expressions or constants.
X+
X+ Both the <ymin> and <ymax> terms are optional.
X+ ?set ytics
X+ ?set xtics
X+ ?noytics
X+ ?noxtics
X+ ?set noytics
X+ ?set noxtics
X+ ?ytics
X+ ?xtics
X+ ?tics
X+ Sometimes the x- or y-axis numbers really don't mean anything, and you
X+ would rather not have the numbers and tics printed on the axis. If
X+ this is the case, insert a
X+ set noxtics
X+ and/or
X+ set noytics
X+ before the plot command. To turn them back on use
X+ set xtics
X+ set ytics
X+ ?set zero
X+ ?show zero
X+ ?zero
X+ GNUTEX will not display points when their imaginary parts are greater
X+ than the 'zero' threshold. The default 'zero' value is 1e-8.
X+
X+ Syntax: set zero <expression>
X+ show zero
X+ ?shell
X+ The 'shell' command spawns an interactive shell. To return to GNUTEX,
X+ type 'logout' if using VMS, 'exit' or your END-OF-FILE character if
X+ using Unix, or 'exit' if using MS-DOS.
X+
X+ A single shell command may be spawned by preceding it with the ! character
X+ at the beginning of a command line. Control will return immediately to
X+ GNUTEX after this command is executed. For example,
X+
X+ ! dir
X+
X+ prints a directory listing and then returns to GNUTEX.
X+
X+ $ is accepted as a synonym for ! in VMS.
X+ ?start-up
X+ ?.gnutex
X+ When GNUTEX is run, it looks for an initialization file to execute.
X+ This file is called '.gnutex' on Unix systems, and 'GNUTEX.INI' on
X+ other systems. If this file is not found in the current directory,
X+ the program will look for it in your home directory (under MS-DOS, the
X+ environment variable GNUTEX should contain the name of this
X+ directory).
X+
X+ If this file is found, GNUTEX executes the commands in this file.
X+ This is most useful for setting your terminal type and defining any
X+ functions or variables which you use often. The variable 'pi' is
X+ already defined for you.
X+ ?substitution
X+ Command-line subsitution is specified by a system command enclosed in
X+ backquotes (``). This command is spawned and the output it produces
X+ replaces the name of the command (and backquotes) on the command line.
X+
X+ Newlines in the output produced by the spawned command are replaced with
X+ blanks.
X+
X+ Command-line substitution can be used anywhere on the GNUTEX command line.
X+
X+ Examples:
X+
X+ a(x) = `leastsq` ; substitutes "`leastsq`" with output produced
X+ by a program named leastsq.
X+ a(x) = `run leastsq.exe` ; same but for VMS.
X+ ?user-defined
X+ You may define your own functions and variables. User-defined functions and
X+ variables may be used anywhere.
X+
X+ User-defined function syntax:
X+ <function-name> ( <dummy-var> ) = <expression>
X+
X+ Where <expression> is defined in terms of <dummy-var>.
X+
X+ User-defined variable syntax:
X+ <variable-name> = <constant-expression>
X+
X+ Examples:
X+ w = 2
X+ q = floor(tan(pi/2 - 0.1))
X+ f(x) = sin(w*x)
X+ sinc(x) = sin(pi*x)/(pi*x)
X+ delta(t) = (t == 0)
X+ ramp(t) = (t > 0) ? t : 0
X+
X+ The variable 'pi' is already defined for you.
X+
X+ See 'show functions' and 'show variables'. See 'latex' for defining
X+ your own linestyles.
Xdiff -cr ../gnutex.old/graphics.c ./graphics.c
X*** ../gnutex.old/graphics.c Fri Feb 10 12:16:09 1989
X--- ./graphics.c Wed Feb 1 12:18:43 1989
X***************
X*** 63,68 ****
X--- 63,71 ----
X #define SIGNIF (0.01) /* less than one hundredth of a tic mark */
X #define CheckZero(x,tic) (fabs(x) < ((tic) * SIGNIF) ? 0.0 : (x))
X
X+ /* (DFK) Use 10^x if logscale is in effect, else x */
X+ #define CheckLog(log, x) ((log) ? pow(10., (x)) : (x))
X+
X /* Remember these from the last do_plot */
X static double last_xmin, last_ymin;
X static double last_xscale, last_yscale;
X***************
X*** 241,256 ****
X least = ytic * floor(ymin/ytic);
X most = ytic * ceil(ymax/ytic);
X if (least >= ymin)
X! (*t->ytick_text)(map_y(least), CheckZero(least,ytic), yformat);
X if (most <= ymax)
X! (*t->ytick_text)(map_y(most), CheckZero(most,ytic), yformat);
X } else {
X least = ytic * floor(ymax/ytic);
X most = ytic * ceil(ymin/ytic);
X if (least >= ymax)
X! (*t->ytick_text)(map_y(least), CheckZero(least,ytic), yformat);
X if (most <= ymin)
X! (*t->ytick_text)(map_y(most), CheckZero(most,ytic), yformat);
X }
X
X for (ticplace = ytic + least; ticplace < most ; ticplace += ytic) {
X--- 244,267 ----
X least = ytic * floor(ymin/ytic);
X most = ytic * ceil(ymax/ytic);
X if (least >= ymin)
X! (*t->ytick_text)(map_y(least),
X! CheckLog(log_y, CheckZero(least,ytic)),
X! yformat);
X if (most <= ymax)
X! (*t->ytick_text)(map_y(most),
X! CheckLog(log_y, CheckZero(most,ytic)),
X! yformat);
X } else {
X least = ytic * floor(ymax/ytic);
X most = ytic * ceil(ymin/ytic);
X if (least >= ymax)
X! (*t->ytick_text)(map_y(least),
X! CheckLog(log_y, CheckZero(least,ytic)),
X! yformat);
X if (most <= ymin)
X! (*t->ytick_text)(map_y(most),
X! CheckLog(log_y, CheckZero(most,ytic)),
X! yformat);
X }
X
X for (ticplace = ytic + least; ticplace < most ; ticplace += ytic) {
X***************
X*** 258,264 ****
X (*t->vector)(t->h_tic,map_y(ticplace));
X (*t->move)(t->xmax-1,map_y(ticplace));
X (*t->vector)(t->xmax-1-t->h_tic,map_y(ticplace));
X! (*t->ytick_text)(map_y(ticplace), CheckZero(ticplace,ytic), yformat);
X }
X }
X
X--- 269,277 ----
X (*t->vector)(t->h_tic,map_y(ticplace));
X (*t->move)(t->xmax-1,map_y(ticplace));
X (*t->vector)(t->xmax-1-t->h_tic,map_y(ticplace));
X! (*t->ytick_text)(map_y(ticplace),
X! CheckLog(log_y, CheckZero(ticplace,ytic)),
X! yformat);
X }
X }
X
X***************
X*** 267,282 ****
X least = xtic * floor(xmin/xtic);
X most = xtic * ceil(xmax/xtic);
X if (least >= xmin)
X! (*t->xtick_text)(map_x(least), CheckZero(least,xtic), xformat);
X if (most <= xmax)
X! (*t->xtick_text)(map_x(most), CheckZero(most,xtic), xformat);
X } else {
X least = xtic * floor(xmax/xtic);
X most = xtic * ceil(xmin/xtic);
X if (least >= xmax)
X! (*t->xtick_text)(map_x(least), CheckZero(least,xtic), xformat);
X if (most <= xmin)
X! (*t->xtick_text)(map_x(most), CheckZero(most,xtic), xformat);
X }
X
X for (ticplace = xtic + least; ticplace < most ; ticplace += xtic) {
X--- 280,303 ----
X least = xtic * floor(xmin/xtic);
X most = xtic * ceil(xmax/xtic);
X if (least >= xmin)
X! (*t->xtick_text)(map_x(least),
X! CheckLog(log_x, CheckZero(least,xtic)),
X! xformat);
X if (most <= xmax)
X! (*t->xtick_text)(map_x(most),
X! CheckLog(log_x, CheckZero(most,xtic)),
X! xformat);
X } else {
X least = xtic * floor(xmax/xtic);
X most = xtic * ceil(xmin/xtic);
X if (least >= xmax)
X! (*t->xtick_text)(map_x(least),
X! CheckLog(log_x, CheckZero(least,xtic)),
X! xformat);
X if (most <= xmin)
X! (*t->xtick_text)(map_x(most),
X! CheckLog(log_x, CheckZero(most,xtic)),
X! xformat);
X }
X
X for (ticplace = xtic + least; ticplace < most ; ticplace += xtic) {
X***************
X*** 284,290 ****
X (*t->vector)(map_x(ticplace),t->v_tic);
X (*t->move)(map_x(ticplace),t->ymax-1);
X (*t->vector)(map_x(ticplace),t->ymax-1-t->v_tic);
X! (*t->xtick_text)(map_x(ticplace), CheckZero(ticplace,xtic), xformat);
X }
X }
X
X--- 305,313 ----
X (*t->vector)(map_x(ticplace),t->v_tic);
X (*t->move)(map_x(ticplace),t->ymax-1);
X (*t->vector)(map_x(ticplace),t->ymax-1-t->v_tic);
X! (*t->xtick_text)(map_x(ticplace),
X! CheckLog(log_x, CheckZero(ticplace,xtic)),
X! xformat);
X }
X }
X
XOnly in ../gnutex.old: help
SHAR_EOF
fi # end of overwriting check
# End of shell archive
exit 0
Department of Computer Science, Duke University, Durham, NC 27706
ARPA: dfk@cs.duke.edu
CSNET: dfk@duke
UUCP: decvax!duke!dfk