home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 80.7 KB | 2,302 lines |
- Newsgroups: comp.sources.misc
- From: woo@playfair.stanford.edu ("Alexander Woo")
- Subject: v40i015: gnuplot - interactive function plotting utility, Part03/33
- Message-ID: <1993Oct21.144231.1461@sparky.sterling.com>
- X-Md4-Signature: afbe21e4c8a29569820f966b5e93de8d
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Thu, 21 Oct 1993 14:42:31 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
- Posting-number: Volume 40, Issue 15
- Archive-name: gnuplot/part03
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot3: Volume 24, Issue 23-48
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: gnuplot/docs/gnuplot.doc.A gnuplot/term/post.trm
- # Wrapped by kent@sparky on Wed Oct 20 17:14:38 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 3 (of 33)."'
- if test -f 'gnuplot/docs/gnuplot.doc.A' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/docs/gnuplot.doc.A'\"
- else
- echo shar: Extracting \"'gnuplot/docs/gnuplot.doc.A'\" \(66025 characters\)
- sed "s/^X//" >'gnuplot/docs/gnuplot.doc.A' <<'END_OF_FILE'
- X1 gnuplot
- X?
- X GNUPLOT is a command-driven interactive function plotting program.
- X
- X For help on any topic, type `help` followed by the name of the topic.
- X
- X The new GNUPLOT user should begin by reading the `introduction` topic
- X (type `help introduction`) and about the `plot` command (type `help plot`).
- X Additional help can be obtained from the USENET newsgroup
- X comp.graphics.gnuplot.
- X
- X2 copyright
- X?copyright
- X Copyright (C) 1986 - 1993 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 Gnuplot 3.0 additions:
- X Gershon Elber and many others.
- X
- X There is a mailing list for gnuplot users. Note, however, that the
- X newsgroup
- X comp.graphics.gnuplot
- X is identical to the mailing list (they
- X both carry the same set of messages). We prefer that you read the
- X messages through that newsgroup, to subscribing to the mailing list.
- X (If you can read that newsgroup, and are already on the mailing list,
- X please send a message info-gnuplot-request@dartmouth.edu, asking to be
- X removed from the mailing list.)
- X
- X The address for mailing to list members is
- X info-gnuplot@dartmouth.edu
- X and for mailing administrative requests is
- X info-gnuplot-request@dartmouth.edu
- X The mailing list for bug reports is
- X bug-gnuplot@dartmouth.edu
- X The list of those interested in beta-test versions is
- X info-gnuplot-beta@dartmouth.edu
- X
- X2 introduction
- X?introduction
- X GNUPLOT 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. Any number
- X of commands may appear on a line, separated by semicolons (;).
- X Strings are indicated with quotes. They may be either single or double
- X quotation marks, e.g.,
- X
- X load "filename"
- X cd 'dir'
- X
- X Any command-line arguments are assumed to be names of files containing
- X GNUPLOT commands, with the exception of standard X11 arguments, which
- X are processed first. Each file is loaded with the `load` command, in the
- X order specified. GNUPLOT exits after the last file is processed. When
- X no load files are named, gnuplot enters into an interactive mode.
- X
- X Commands may extend over several input lines, by ending each
- X line but 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 (see `comment`).
- X
- X In this documentation, curly braces ({}) denote optional arguments to
- X many commands, and a vertical bar (|) separates mutually exclusive
- X choices. GNUPLOT keywords or help topics are indicated by backquotes
- X or `boldface` (where available). Angle brackets (<>) are used to mark
- X replaceable tokens.
- X
- X For help on any topic, type `help` followed by the name of the topic.
- X
- X The new GNUPLOT user should begin by reading about the `plot`
- X command (type `help plot`).
- X2 cd
- X?cd
- X The `cd` command changes the working directory.
- X
- X Syntax:
- X cd "<directory-name>"
- X
- X The directory name must be enclosed in quotes.
- X
- X Examples:
- X cd 'subdir'
- X cd ".."
- X2 clear
- X?clear
- X The `clear` command erases the current screen or output device as
- X specified by `set output`. This usually generates a formfeed on
- X hardcopy devices. Use `set terminal` to set the device type.
- X2 command line-editing
- X?line-editing
- X?editing
- X?history
- X?command line-editing
- X The Unix, Atari, VMS, MS-DOS and OS/2 versions of GNUPLOT support command
- X line-editing. Also, a history mechanism allows previous commands to be
- X edited, and re-executed. After the command line has been edited, a newline
- X or carriage return will enter the entire line regardless of where the
- X cursor is positioned.
- X
- X The editing commands are as follows:
- X
- X@start table - first is interactive cleartext form
- X `Line-editing`:
- X
- X ^B moves back a single character.
- X ^F moves forward a single character.
- X ^A moves to the beginning of the line.
- X ^E moves to the end of the line.
- X ^H and DEL delete the previous character.
- X ^D deletes the current character.
- X ^K deletes from current position to the end of line.
- X ^L,^R redraws line in case it gets trashed.
- X ^U deletes the entire line.
- X ^W deletes the last word.
- X
- X `History`:
- X
- X ^P moves back through history.
- X ^N moves forward through history.
- X#Character && Function \\ \hline
- X#\multicolumn{3}{|c|}{Line Editing}\\
- X#\verb~^B~ && move back a single character.\\
- X#\verb~^F~ && move forward a single character.\\
- X#\verb~^A~ && move to the beginning of the line.\\
- X#\verb~^E~ && move to the end of the line.\\
- X#\verb~^H, DEL~ && delete the previous character.\\
- X#\verb~^D~ && delete the current character.\\
- X#\verb~^K~ && delete from current position to the end of line.\\
- X#\verb~^L, ^R~ && redraw line in case it gets trashed.\\
- X#\verb~^U~ && delete the entire line. \\
- X#\verb~^W~ && delete from the current word to the end of line. \\ \hline
- X#\multicolumn{3}{|c|}{History} \\
- X#\verb~^P~ && move back through history.\\
- X#\verb~^N~ && move forward through history.\\
- X%Character@@Function
- X%_
- X%@@Line Editing
- X%^B@@move back a single character.
- X%^F@@move forward a single character.
- X%^A@@move to the beginning of the line.
- X%^E@@move to the end of the line.
- X%^H, DEL@@delete the previous character.
- X%^D@@delete the current character.
- X%^K@@delete from current position to the end of line.
- X%^L, ^R@@redraw line in case it gets trashed.
- X%^U@@delete the entire line.
- X%^W@@delete from the current word to the end of line.
- X%_
- X%@@History
- X%^P@@move back through history.
- X%^N@@move forward through history.
- X@end table
- X
- X On the IBM PC the use of a TSR program such as DOSEDIT or CED may be
- X desired for line editing. For such a case GNUPLOT may be compiled with
- X no line editing capability (default makefile setup). Set READLINE in the
- X makefile and add readline.obj to the link file if GNUPLOT line editing
- X is to be used for the IBM PC. The following arrow keys may be used
- X on the IBM PC and Atari versions if readline is used:
- X
- X@start table - first is interactive cleartext form
- X Left Arrow - same as ^B.
- X Right Arrow - same as ^F.
- X Ctl Left Arrow - same as ^A.
- X Ctl Right Arrow - same as ^E.
- X Up Arrow - same as ^P.
- X Down Arrow - same as ^N.
- X#Arrow key & Function & \\ \hline
- X#Left & same as \verb~^B~. & \\
- X#Right & same as \verb~^F~. & \\
- X#Ctl Left & same as \verb~^A~. & \\
- X#Ctl Right & same as \verb~^E~. & \\
- X#Up & same as \verb~^P~. & \\
- X#Down & same as \verb~^N~. & \\
- X%Arrow key@@Function
- X%_
- X%Left Arrow@@same as ^B.
- X%Right Arrow@@same as ^F.
- X%Ctl Left Arrow@@same as ^A.
- X%Ctl Right Arrow@@same as ^E.
- X%Up Arrow@@same as ^P.
- X%Down Arrow@@same as ^N.
- X%_
- X@end table
- X
- X The Atari version of readline defines some additional key aliases:
- X
- X@start table - first is interactive cleartext form
- X Undo - same as ^L.
- X Home - same as ^A.
- X Ctrl Home - same as ^E.
- X ESC - same as ^U.
- X Help - `help' plus return.
- X Ctrl Help - `help '.
- X#Arrow key & Function & \\ \hline
- X#Undo & same as \verb~^L~. & \\
- X#Home & same as \verb~^A~. & \\
- X#Ctrl Home & same as \verb~^E~. & \\
- X#ESC & same as \verb~^U~. & \\
- X#Help & `{\bf help}' plus return. & \\
- X#Ctrl Help & `{\bf help }'. & \\
- X%Arrow key@@Function
- X%_
- X%Undo@@same as ^L.
- X%Home@@same as ^A.
- X%Ctrl Home@@same as ^E.
- X%ESC@@same as ^U.
- X%Help@@help plus return.
- X%Ctrl Help@@help .
- X%_
- X@end table
- X
- X (The readline function in gnuplot is not the same as the readline used
- X in GNU BASH and GNU EMACS. It is somewhat compatible however.)
- X2 comment
- X?comments
- X Comments are supported as follows: a # may appear in most places in a line
- X and GNUPLOT will ignore the rest of the line. It will not have this
- X effect inside quotes, inside numbers (including complex numbers), inside
- X command substitutions, etc. In short, it works anywhere it makes sense
- X to work.
- X2 environment
- X?environment
- X A number of shell environment variables are understood by GNUPLOT.
- X None of these are required, but may be useful.
- X
- X If GNUTERM is defined, it is used as the name of the terminal type to
- X be used. This overrides any terminal type sensed by GNUPLOT on start
- X up, but is itself overridden by the .gnuplot (or equivalent) start-up
- X file (see `start-up`), and of course by later explicit changes.
- X
- X On Unix, AmigaDOS, AtariTOS, MS-DOS and OS/2, GNUHELP may be defined
- X to be the pathname of the HELP file (gnuplot.gih).
- X
- X On VMS, the symbol GNUPLOT$HELP should be defined as the name of
- X the help library for GNUPLOT.
- X
- X On Unix, HOME is used as the name of a directory to search for
- X a .gnuplot file if none is found in the current directory.
- X On AmigaDOS, AtariTOS, MS-DOS and OS/2, GNUPLOT is used. On VMS, SYS$LOGIN:
- X is used. See `help start-up`.
- X
- X On Unix, PAGER is used as an output filter for help messages.
- X
- X On Unix, AtariTOS and AmigaDOS, SHELL is used for the `shell` command.
- X On MS-DOS and OS/2, COMSPEC is used for the `shell` command.
- X
- X On AmigaDOS, GNUFONT is used for the screen font. For example:
- X "setenv GNUFONT sapphire/14".
- X
- X On MS-DOS, if the BGI interface is used, the variable `BGI` is used to point
- X to the full path of the BGI drivers directory. Furthermore SVGA is used to
- X name the Super VGA BGI driver in 800x600 res., and its mode of operation
- X as 'Name.Mode'.
- X E.g., if the Super VGA driver is C:\TC\BGI\SVGADRV.BGI and mode 3 is
- X used for 800x600 res., then: 'set BGI=C:\TC\BGI' and 'set SVGA=SVGADRV.3'.
- X2 exit
- X?exit
- X?quit
- X The commands `exit` and `quit` and the END-OF-FILE character
- X will exit GNUPLOT. All these commands will clear the output device
- X (as the `clear` command does) before exiting.
- X2 expressions
- X?expressions
- X In general, any mathematical expression accepted by C, FORTRAN,
- X Pascal, or BASIC is valid. The precedence of these operators is
- X determined by the specifications of the C programming language.
- X White space (spaces and tabs) is ignored inside expressions.
- X
- X Complex constants may be expressed as the {<real>,<imag>}, where <real>
- X and <imag> must be numerical constants. For example, {3,2}
- X represents 3 + 2i; {0,1} represents `i` itself. The curly braces
- X are explicitly required here.
- X3 functions
- X?expressions functions
- X?functions
- X The functions in GNUPLOT are the same as the corresponding functions
- X in the Unix math library, except that all functions accept integer,
- X real, and complex arguments, unless otherwise noted. The `sgn`
- X function is also supported, as in BASIC.
- X@start table
- X#Function & Arguments & Returns \\ \hline
- X%Function@Arguments@Returns
- X%_
- X4 abs
- X?expressions functions abs
- X?functions abs
- X?abs
- X#abs(x) & any & absolute value of {\tt x}, $|x|$; same type \\
- X#abs(x) & complex & length of {\tt x}, $\sqrt{{\mbox{real}(x)^{2} +
- X#\mbox{imag}(x)^{2}}}$ \\
- X%abs(x)@any@absolute value of x, $|x|$; same type
- X%abs(x)@complex@length of x, $sqrt{roman real (x) sup 2 + roman imag (x) sup 2}$
- X The `abs` function returns the absolute value of its argument. The
- X 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(x)**2 + imag(x)**2) ].
- X4 acos
- X?expressions functions acos
- X?functions acos
- X?acos
- X#acos(x) & any & $\cos^{-1} x$ (inverse cosine) in radians \\
- X%acos(x)@any@$cos sup -1 x$ (inverse cosine) in radians
- X The `acos` function returns the arc cosine (inverse cosine) of its
- X argument. `acos` returns its argument in radians.
- X4 arg
- X?expressions functions arg
- X?functions arg
- X?arg
- X#arg(x) & complex & the phase of $x$ in radians\\
- X%arg(x)@complex@the phase of $x$ in radians
- X The `arg` function returns the phase of a complex number, in radians.
- X4 asin
- X?expressions functions asin
- X?functions asin
- X?asin
- X#asin(x) & any & $\sin^{-1} x$ (inverse sin) in radians \\
- X%asin(x)@any@$sin sup -1 x$ (inverse sin) in radians
- X The `asin` function returns the arc sin (inverse sin) of its argument.
- X `asin` returns its argument in radians.
- X4 atan
- X?expressions functions atan
- X?functions atan
- X?atan
- X#atan(x) & any & $\tan^{-1} x$ (inverse tangent) in radians \\
- X%atan(x)@any@$tan sup -1 x$ (inverse tangent) in radians
- X The `atan` function returns the arc tangent (inverse tangent) of its
- X argument. `atan` returns its argument in radians.
- X4 besj0
- X?expressions functions besj0
- X?functions besj0
- X?besj0
- X#besj0(x) & radians & $j_{0}$ Bessel function of $x$ \\
- X%besj0(x)@radians@$j sub 0$ Bessel function of $x$
- X The `besj0` function returns the j0th Bessel function of its argument.
- X `besj0` expects its argument to be in radians.
- X4 besj1
- X?expressions functions besj1
- X?functions besj1
- X?besj1
- X#besj1(x) & radians & $j_{1}$ Bessel function of $x$ \\
- X%besj1(x)@radians@$j sub 1$ Bessel function of $x$
- X The `besj1` function returns the j1st Bessel function of its argument.
- X `besj1` expects its argument to be in radians.
- X4 besy0
- X?expressions functions besy0
- X?functions besy0
- X?besy0
- X#besy0(x) & radians & $y_{0}$ Bessel function of $x$ \\
- X%besy0(x)@radians@$y sub 0$ Bessel function of $x$
- X The `besy0` function returns the y0th Bessel function of its argument.
- X `besy0` expects its argument to be in radians.
- X4 besy1
- X?expressions functions besy1
- X?functions besy1
- X?besy1
- X#besy1(x) & radians & $y_{1}$ Bessel function of $x$ \\
- X%besy1(x)@radians@$y sub 1$ Bessel function of $x$
- X The `besy1` function returns the y1st Bessel function of its argument.
- X `besy1` expects its argument to be in radians.
- X4 ceil
- X?expressions functions ceil
- X?functions ceil
- X?ceil
- X#ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
- X#(real part) \\
- X%ceil(x)@any@$left ceiling x right ceiling$, smallest integer not less than $x$ (real part)
- X The `ceil` function returns the smallest integer that is not less than its
- X argument. For complex numbers, `ceil` returns the smallest integer
- X not less than the real part of its argument.
- X4 cos
- X?expressions functions cos
- X?functions cos
- X?cos
- X#cos(x) & radians & $\cos x$, cosine of $x$ \\
- X%cos(x)@radians@$cos~x$, cosine of $x$
- X The `cos` function returns the cosine of its argument. `cos` expects its
- X argument to be in radians.
- X4 cosh
- X?expressions functions cosh
- X?functions cosh
- X?cosh
- X#cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \\
- X%cosh(x)@radians@$cosh~x$, hyperbolic cosine of $x$
- X The `cosh` function returns the hyperbolic cosine of its argument.
- X `cosh` expects its argument to be in radians.
- X4 erf
- X?expressions functions erf
- X?functions erf
- X?erf
- X#erf(x) & any & $\mbox{Erf}(\mbox{real}(x))$, error function of real($x$) \\
- X%erf(x)@any@$erf ( roman real (x))$, error function of real ($x$)
- X The `erf` function returns the error function of the real part of
- X its argument.
- X If the argument is a complex value, the imaginary component is ignored.
- X4 erfc
- X?expressions functions erfc
- X?functions erfc
- X?erfc
- X#erfc(x) & any & $\mbox{Erfc}(\mbox{real}(x))$, 1.0 - error function of real($x$) \\
- X%erfc(x)@any@$erfc ( roman real (x))$, 1.0 - error function of real ($x$)
- X The `erfc` function returns 1.0 - the error function of the
- X real part of its argument.
- X If the argument is a complex value, the imaginary component is ignored.
- X4 exp
- X?expressions functions exp
- X?functions exp
- X?exp
- X#exp(x) & any & $e^{x}$, exponential function of $x$ \\
- X%exp(x)@any@$e sup x$, exponential function of $x$
- X The `exp` function returns the exponential function of its argument
- X (`e` raised to the power of its argument).
- X4 floor
- X?expressions functions floor
- X?functions floor
- X?floor
- X#floor(x) & any & $\lfloor x \rfloor$, largest integer not greater
- X#than $x$ (real part) \\
- X%floor(x)@any@$left floor x right floor$, largest integer not greater than $x$ (real part)
- X The `floor` function returns the largest integer not greater than its
- X argument. For complex numbers, `floor` returns the largest
- X integer not greater than the real part of its argument.
- X4 gamma
- X?expressions functions gamma
- X?functions gamma
- X?gamma
- X#gamma(x) & any & $\mbox{Gamma}(\mbox{real}(x))$, gamma function of real($x$) \\
- X%gamma(x)@any@$GAMMA ( roman real (x))$, gamma function of real ($x$)
- X The `gamma` function returns the gamma function of the real part of
- X its argument. For integer n, gamma(n+1) = n! .
- X If the argument is a complex value, the imaginary component is ignored.
- X4 ibeta
- X?expressions functions ibeta
- X?functions ibeta
- X?ibeta
- X#ibeta(p,q,x) & any & $\mbox{Ibeta}(\mbox{real}(p,q,x))$, ibeta function of real($p$,$q$,$x$) \\
- X%ibeta(p,q,x)@any@$Ibeta ( roman real (p,q,x))$, ibeta function of real ($p$,$q$,$x$)
- X The `ibeta` function returns the incomplete beta function of the real
- X parts of its arguments. p, q > 0 and x in [0:1]
- X If the arguments are complex, the imaginary components are ignored.
- X4 inverf
- X?expressions functions inverf
- X?functions inverf
- X?inverf
- X#inverf(x) & any & inverse error function of real($x$) \\
- X%inverf(x)@any@inverse error function real($x$)
- X The `inverf` function returns the inverse error function of the real
- X part of its argument.
- X4 igamma
- X?expressions functions igamma
- X?functions igamma
- X?igamma
- X#igamma(a,x) & any & $\mbox{Igamma}(\mbox{real}(a,x))$, igamma function of real($a$,$x$) \\
- X%igamma(a,x)@any@$Igamma ( roman real (a,x))$, igamma function of real ($a$,$x$)
- X The `igamma` function returns the incomplete gamma function of the real
- X parts of its arguments. a > 0 and x >= 0
- X If the arguments are complex, the imaginary components are ignored.
- X4 imag
- X?expressions functions imag
- X?functions imag
- X?imag
- X#imag(x) & complex & imaginary part of $x$ as a real number \\
- X%imag(x)@complex@imaginary part of $x$ as a real number
- X The `imag` function returns the imaginary part of its argument as a
- X real number.
- X4 invnorm
- X?expressions functions invnorm
- X?functions invnorm
- X?invnorm
- X#invnorm(x) & any & inverse normal distribution function of real($x$) \\
- X%invnorm(x)@any@inverse normal distribution function real($x$)
- X The `invnorm` function returns the inverse normal distribution function
- X of the real part of its argument.
- X4 int
- X?expressions functions int
- X?functions int
- X?int
- X#int(x) & real & integer part of $x$, truncated toward zero \\
- X%int(x)@real@integer part of $x,$ truncated toward zero
- X The `int` function returns the integer part of its argument, truncated
- X toward zero.
- X4 lgamma
- X?expressions functions lgamma
- X?functions lgamma
- X?lgamma
- X#lgamma(x) & any & $\mbox{Lgamma}(\mbox{real}(x))$, lgamma function of real($x$) \\
- X%lgamma(x)@any@$Lgamma ( roman real (x))$, lgamma function of real ($x$)
- X The `lgamma` function returns the natural logarithm of the gamma
- X function of the real part of its argument.
- X If the argument is a complex value, the imaginary component is ignored.
- X4 log
- X?expressions functions log
- X?functions log
- X?log
- X#log(x) & any & $\log_{e} x$, natural logarithm (base $e$) of $x$ \\
- X%log(x)@any@$ln~x$, natural logarithm (base $e$) of $x$
- X The `log` function returns the natural logarithm (base `e`) of its
- X argument.
- X4 log10
- X?expressions functions log10
- X?functions log10
- X?log10
- X#log10(x) & any & $\log_{10} x$, logarithm (base $10$) of $x$ \\
- X%log10(x)@any@${log sub 10}~x$, logarithm (base $10$) of $x$
- X The `log10` function returns the logarithm (base 10) of its argument.
- X4 norm
- X?expressions functions norm
- X?functions norm
- X?norm
- X#norm(x) & any & normal distribution (Gaussian) function of real($x$) \\
- X%norm(x)@any@$norm(x),$ normal distribution function of real($x$)
- X The `norm` function returns the normal distribution function
- X (or Gaussian) of the real part of its argument.
- X4 rand
- X?expressions functions rand
- X?functions rand
- X?rand
- X#rand(x) & any & $\mbox{Rand}(\mbox{real}(x))$, pseudo random number generator \\
- X%rand(x)@any@$rand ( roman real (x))$, pseudo random number generator
- X The `rand` function returns a pseudo random number in the interval [0:1]
- X using the real part of its argument as a seed. If seed < 0 the sequence
- X is (re)initialized.
- X If the argument is a complex value, the imaginary component is ignored.
- X4 real
- X?expressions functions real
- X?functions real
- X?real
- X#real(x) & any & real part of $x$ \\
- X%real(x)@any@real part of $x$
- X The `real` function returns the real part of its argument.
- X4 sgn
- X?expressions functions sgn
- X?functions sgn
- X?sgn
- X#sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \\
- X%sgn(x)@any@1 if $x > 0$, -1 if $x < 0$, 0 if $x = 0$. $roman imag (x)$ ignored
- X The `sgn` 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.
- X4 sin
- X?expressions functions sin
- X?functions sin
- X?sin
- X#sin(x) & radians & $\sin x$, sine of $x$ \\
- X%sin(x)@radians@$sin~x$, sine of $x$
- X The `sin` function returns the sine of its argument. `sin` expects its
- X argument to be in radians.
- X4 sinh
- X?expressions functions sinh
- X?functions sinh
- X?sinh
- X#sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \\
- X%sinh(x)@radians@$sinh~x$, hyperbolic sine $x$
- X The `sinh` function returns the hyperbolic sine of its argument. `sinh`
- X expects its argument to be in radians.
- X4 sqrt
- X?expressions functions sqrt
- X?functions sqrt
- X?sqrt
- X#sqrt(x) & any & $\sqrt{x}$, square root of $x$ \\
- X%sqrt(x)@any@$sqrt x $, square root of $x$
- X The `sqrt` function returns the square root of its argument.
- X4 tan
- X?expressions functions tan
- X?functions tan
- X?tan
- X#tan(x) & radians & $\tan x$, tangent of $x$ \\
- X%tan(x)@radians@$tan~x$, tangent of $x$
- X The `tan` function returns the tangent of its argument. `tan` expects
- X its argument to be in radians.
- X4 tanh
- X?expressions functions tanh
- X?functions tanh
- X?tanh
- X#tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\\
- X%tanh(x)@radians@$tanh~x$, hyperbolic tangent of $x$
- X The `tanh` function returns the hyperbolic tangent of its argument.
- X `tanh` expects its argument to be in radians.
- X@end table
- X3 operators
- X?expressions operators
- X?operators
- X The operators in GNUPLOT are the same as the corresponding operators
- X in the C programming language, except that all operators accept
- X integer, real, and complex arguments, unless otherwise noted.
- X The ** operator (exponentiation) is supported, as in FORTRAN.
- X
- X Parentheses may be used to change order of evaluation.
- X4 binary
- X?expressions operators binary
- X?operators binary
- X?binary
- X The following is a list of all the binary operators and their
- X usages:
- X
- X@start table - first is interactive cleartext form
- 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 * ternary operation
- X#\multicolumn{3}{|c|}{Binary Operators} \\
- X#Symbol & Example & Explanation \\ \hline
- X#\verb~**~ & \verb~a**b~ & exponentiation\\
- X#\verb~*~ & \verb~a*b~ & multiplication\\
- X#\verb~/~ & \verb~a/b~ & division\\
- X#\verb~%~ & \verb~a%b~ & * modulo\\
- X#\verb~+~ & \verb~a+b~ & addition\\
- X#\verb~-~ & \verb~a-b~ & subtraction\\
- X#\verb~==~ & \verb~a==b~ & equality\\
- X#\verb~!=~ & \verb~a!=b~ & inequality\\
- X#\verb~&~ & \verb~a&b~ & * bitwise AND\\
- X#\verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
- X#\verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
- X#\verb~&&~ & \verb~a&&b~ & * logical AND\\
- X#\verb~||~ & \verb~a||b~ & * logical OR\\
- X#\verb~?:~ & \verb~a?b:c~ & * ternary operation\\
- X%Symbol@Example@Explanation
- X%_
- 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@* ternary operation
- X
- X@end table
- X (*) Starred explanations indicate that the operator requires
- X integer arguments.
- X
- X Logical AND (&&) and OR (||) short-circuit the way they do in C.
- X That is, the second && operand is not evaluated if the first is
- X false; the second || operand is not evaluated if the first is true.
- X
- X The ternary operator evaluates its first argument (a). If it is
- X true (non-zero) the second argument (b) is evaluated and returned,
- X otherwise the third argument (c) is evaluated and returned.
- X4 unary
- X?expressions operators unary
- X?operators unary
- X?unary
- X The following is a list of all the unary operators and their
- X usages:
- X
- X@start table - first is interactive cleartext form
- X Symbol Example Explanation
- X - -a unary minus
- X ~ ~a * one's complement
- X ! !a * logical negation
- X ! a! * factorial
- X#\multicolumn{3}{|c|}{Unary Operators}\\
- X#Symbol & Example & Explanation \\ \hline
- X#\verb@-@ & \verb@-a@ & unary minus \\
- X#\verb@~@ & \verb@~a@ & * one's complement \\
- X#\verb@!@ & \verb@!a@ & * logical negation \\
- X#\verb@!@ & \verb@a!@ & * factorial \\
- X%-@-a@unary minus
- X%~@~a@* one's complement
- X%!@!a@* logical negation
- X%!@a!@* factorial
- X
- X@end table
- X (*) Starred explanations indicate that the operator requires an
- X integer argument.
- X
- X The factorial operator returns a real number to allow a greater range.
- X2 help
- X?help
- X The `help` command displays on-line help. To specify information on a
- X particular topic use the syntax:
- X
- X help {<topic>}
- X
- X If <topic> is not specified, a short message is printed about
- X GNUPLOT. After help for the requested topic is given, help for a
- X subtopic may be requested by typing its name, extending the help
- X request. After that subtopic has been printed, the request may be
- X extended again, or simply pressing return goes back one level to the
- X previous topic. Eventually, the GNUPLOT command line will return.
- X2 load
- X?load
- X The `load` command executes each line of the specified input file as
- X if it had been typed in interactively. Files created by the `save`
- X command can later be `load`ed. Any text file containing valid
- X commands can be created and then executed by the `load` command.
- X Files being `load`ed may themselves contain `load` commands. See
- X `comment` for information about comments in commands.
- X
- X The `load` command must be the last command on the line.
- X
- X Syntax:
- X load "<input-file>"
- X
- X The name of the input file must be enclosed in quotes.
- X
- X Examples:
- X
- X load 'work.gnu'
- X load "func.dat"
- X
- X The `load` command is performed implicitly on any file names given as
- X arguments to GNUPLOT. These are loaded in the order specified, and
- X then GNUPLOT exits.
- X2 pause
- X?pause
- X The `pause` command displays any text associated with the command and
- X then waits a specified amount of time or until the carriage return is
- X pressed. `pause` is especially useful in conjunction with `load` files.
- X
- X Syntax:
- X pause <time> {"<string>"}
- X
- X <time> may be any integer constant or expression. Choosing -1 will
- X wait until a carriage return is hit, zero (0) won't pause at all, and
- X a positive integer will wait the specified number of seconds.
- X
- X Note: Since `pause` is not part of the plot it may interact with
- X different device drivers differently (depending upon how text and
- X graphics are mixed).
- X
- X Examples:
- X pause -1 # Wait until a carriage return is hit
- X pause 3 # Wait three seconds
- X pause -1 "Hit return to continue"
- X pause 10 "Isn't this pretty? It's a cubic-spline."
- X
- X2 plot
- X?plot
- X?splot
- X `plot` and `splot` are the primary commands of the program. They plot
- X functions and data in many, many ways. `plot` is used to plot 2-d
- X functions and data, while `splot` plots 3-d surfaces and data.
- X
- X Syntax:
- X
- X plot {ranges} {<function> | {"<datafile>" {using ...}}}
- X {title} {style} {, <function> {title} {style}...}
- X
- X splot {ranges} {<function> | {"<datafile>" {index i} {using ...}}}
- X {title} {style} {, <function> {title} {style}...}
- X
- X where either a <function> or the name of a data file enclosed in quotes is
- X supplied. A function is a mathematical expression, or a pair (`plot`) or
- X triple (`splot`) of mathematical expressions in the case of parametric
- X functions. User-defined functions and variables may also be defined here.
- X
- X `plot` and `splot` commands can be as simple as
- X
- X plot sin(x)
- X
- X and
- X
- X splot x * y
- X
- X or as complex as (!)
- X
- X plot [t=1:10] [-pi:pi*2] tan(t), "data.1" using 2:3 with lines,
- X t**2 with points
- X3 data-file
- X?plot data-file
- X?plot datafile
- X?splot data-file
- X?splot datafile
- X?data-file
- X?datafile
- X?data
- X Discrete data contained in a file can be displayed by specifying the
- X name of the data file (enclosed in quotes) on the `plot` or `splot`
- X command line. Data files should contain one data point per line.
- X Lines beginning with # (or ! on VMS) will be treated as comments
- X and ignored. For `plot`s, each data point represents an (x,y)
- X pair. For `splot`s, each point is an (x,y,z) triple. For `plot`s with
- X error bars (see `plot errorbars`), each data point is either
- X (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
- X line of a data file must be separated by blank space. This blank
- X space divides each line into columns.
- X
- X For `plot`s the x value may be omitted, and for `splot`s the x
- X and y values may be omitted. In either case the omitted values are
- X assigned the current coordinate number. Coordinate numbers start at 0
- X and are incremented for each data point read.
- X
- X To specify other formats, see `plot datafile using`.
- X
- X In the `plot` command, blank lines in the data file cause a break in
- X the plot. There will be no line drawn between the preceding and
- X following points if the plot style is `lines` or `linespoints` (see
- X `plot style`). This does not change the plot style, as would plotting
- X the data as separate curves.
- X
- X This example compares the data in the file population.dat to a
- X theoretical curve:
- X
- 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
- X When a data file is plotted, `samples` and `isosamples` are ignored.
- X Curves plotted using the `plot` command are automatically extended to
- X hold the entire curve. Similarly grid data plotted using the `splot`
- X command is automatically extended, using the assumption that isolines
- X are separated by blank lines (a line with only a CR/LF in it).
- X
- X Implicitly, there are two types of 3-d datafiles. If all the isolines
- X are of the same length, the data is assumed to be a grid data, i.e.,
- X the data has a grid topology. Cross isolines in the other parametric
- X direction (the ith cross isoline passes through the ith point of all the
- X provided isolines) will also be drawn for grid data. (Note contouring
- X is available for grid data only.) If all the isolines are not of the
- X same length, no cross isolines will be drawn and contouring that data
- X is impossible.
- X
- X For splot, data files may contain more than one mesh and by default
- X all meshes are plotted. Meshes are separated from each other, in the
- X file, by double blank lines. To control and splot a single mesh from
- X a multi mesh file, use the index modifier. See `splot index` for more.
- X
- X For splot if 3-d datafile and using format (see `splot datafile using`)
- X specify only z (height field), a non parametric mode must be specified.
- X If, on the other hand, x, y, and z are all specified, a parametric
- X mode should be selected (see `set parametric`) since data is defining a
- X parametric surface.
- X
- X A simple example of plotting a 3-d data file is
- X
- X set parametric
- X splot 'glass.dat'
- X
- X or
- X
- X set noparametric
- X splot 'datafile.dat'
- X
- X where the file datafile.dat might contain:
- X
- X # The valley of the Gnu.
- X 10
- X 10
- X 10
- X
- X 10
- X 5
- X 10
- X
- X 10
- X 1
- X 10
- X
- X 10
- X 0
- X 10
- X
- X Note datafile.dat defines a 4 by 3 grid ( 4 rows of 3 points each ).
- X Rows are separated by blank lines.
- X
- X On some computer systems with a popen function (UNIX), the datafile
- X can be piped through a shell command by starting the file name
- X with a '<'. For example:
- X
- X pop(x) = 103*exp(-x/10)
- X plot '< awk "{print $1-1965, $2}" population.dat', pop(x)
- X
- X would plot the same information as the first population example
- X but with years since 1965 as the x axis. If you want to execute
- X this example, you have to delete all comments from the data file
- X above or substitute the following command for the first part of the
- X command above (the part up to the comma):
- X
- X plot '< awk "$0 !~ /^#/ {print $1-1965, $2}" population.dat'
- X
- X It is also possible to apply a single function to the "y" value only,
- X e.g.
- X
- X plot 'population.dat' thru p(x)
- X
- X For more information about 3-d plotting, see `splot`.
- X4 using
- X?plot data-file using
- X?plot datafile using
- X?splot data-file using
- X?splot datafile using
- X?using
- X The format of data within a file can be selected with the `using`
- X option. An explicit scanf string can be used, or simpler column
- X choices can be made.
- X
- X Syntax:
- X
- X plot "datafile" { using { <ycol> |
- X <xcol>:<ycol> |
- X <xcol>:<ycol>:<ydelta> |
- X <xcol>:<ycol>:<ylow>:<yhigh> |
- X <xcol>:<ycol>:<ylow>:<yhigh>:<boxwidth> }
- X {"<scanf string>"} } ...
- X
- X and
- X
- X splot "datafile" { using { <xcol>:<ycol>:<zcol> | <zcol> }
- X {"<scanf string>"} } ...
- X
- X <xcol>, <ycol>, and <zcol> explicitly select the columns to plot from
- X a space or tab separated multicolumn data file. If only <ycol> is
- X selected for `plot`, <xcol> defaults to 1. If only <zcol> is selected
- X for `splot`, then only that column is read from the file. An <xcol> of
- X 0 forces <ycol> to be plotted versus its coordinate number. <xcol>,
- X <ycol>, and <zcol> can be entered as constants or expressions.
- X
- X If errorbars (see also `plot errorbars`) are used for `plot`s,
- X ydelta (for example, a +/- error) should be provided as the third
- X column, or ylow and yhigh as third and fourth columns.
- X
- X If boxes or boxerrorbars are used for `plot`s, a fifth column to
- X specify the width of the box may be given. This implies that columns
- X three and four must also be provided even if they are not used.
- X If you want to plot boxes from a data file with three columns,
- X set ylow and yhigh to y using the following command:
- X plot "datafile" using 1:2:2:2:3 with boxes
- X
- X Scanf strings override any <xcol>:<ycol>(:<zcol>) choices, except for
- X ordering of input, e.g.,
- X plot "datafile" using 2:1 "%f%*f%f"
- X causes the first column to be y and the third column to be x.
- X
- X If the scanf string is omitted, the default is generated based on the
- X <xcol>:<ycol>(:<zcol>) choices. If the `using` option is omitted, "%f%f"
- X is used for `plot` ("%f%f%f%f" for `errorbars` `plot`s) and "%f%f%f" is
- X used for `splot`.
- X
- X Examples:
- X
- X plot "MyData" using "%*f%f%*20[^\n]%f" with lines
- X
- X Data are read from the file "MyData" using the format
- X "%*f%f%*20[^\n]%f". The meaning of this format is: "%*f" ignore the
- X first number, "%f" then read in the second and assign to x,
- X "%*20[^\n]" then ignore 20 non-newline characters, "%f" then read in
- X the y value.
- X
- X n=3;
- X plot "MyData", "MyData" using n
- X
- X causes GNUPLOT to plot the second and third columns of MyData versus
- X the first column. The command 'n=4; replot' would then plot the second
- X and fourth columns of MyData versus the first column.
- X
- X splot "glass.dat" using 1
- X
- X causes GNUPLOT to plot the first coordinate of the points of glass.dat
- X as the z coordinate while ignoring the other two coordinates.
- X
- X Note: GNUPLOT first reads a line of the data file into a buffer and
- X then does a
- X sscanf(input_buffer, scanf_string, &x, &y{, &z});
- X where 'x', 'y', and 'z' are of type 'float'. Any scanf string that
- X specifies two (three for `splot`, three or four for `errorbars`) float
- X numbers may be used.
- X3 errorbars
- X?plot errorbars
- X?errorbars
- X Error bars are supported for 2-d data file plots by reading one or
- X two additional columns specifying ydelta or ylow and yhigh
- X respectively. No support exists for x error bars or any error bars
- X for `splot`s.
- X
- X In the default situation, GNUPLOT expects to see three or four
- X numbers on each line of the data file, either (x, y, ydelta) or
- X (x, y, ylow, yhigh). The x coordinate must be specified. The order
- X of the numbers must be exactly as given above. Data files in this
- X format can easily be plotted with error bars:
- X
- X plot "data.dat" with errorbars
- X
- X The error bar is a vertical line plotted from (x, ylow) to (x,
- X yhigh). If ydelta is specified instead of ylow and yhigh,
- X ylow=y-ydelta and yhigh=y+ydelta are derived. If there
- X are only two numbers on the line, yhigh and ylow are both set to
- X y. To get lines plotted between the data points, `plot` the
- X data file twice, once with errorbars and once with lines.
- X
- X If y autoscaling is on, the y range will be adjusted to fit the
- X error bars.
- X
- X The `using` option may be used to specify how columns of the data file
- X are to be assigned to x, y, ydelta, ylow, and yhigh. The x column must
- X be provided and both the x and y columns must appear before the
- X errorbar columns. If three column numbers are given, they are x, y,
- X and ydelta. If four columns are given, they are x, y, ylow, and
- X yhigh.
- X
- X Examples:
- X
- X plot "data.dat" using 1:2:3:4 with errorbars
- X plot "data.dat" using 3:2:6 with errorbars
- X plot "data.dat" using 3:4:8:7 with errorbars
- X
- X The first example reads, x, y, ylow, and yhigh, from columns 1, 2, 3,
- X and 4. This is equivalent to the default. The second example reads x
- X from the third column, y from second and ydelta from the sixth column.
- X The third example reads x from the third column, y from the fourth,
- X ylow from the eighth, and yhigh from seventh columns.
- X
- X See also `plot using` and `plot style`.
- X3 parametric
- X?plot parametric
- X?splot parametric
- X?parametric
- X When in parametric mode (`set parametric`) mathematical expressions must
- X be given in pairs for `plot` and in triplets for `splot`:
- X plot sin(t),t**2
- X or
- X splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
- X
- X Data files are plotted as before, except any preceding parametric
- X function must be fully specified before a data file is given as a
- X plot. In other words, the x parametric function (sin(t) above) and
- X the y parametric function (t**2 above) must not be interrupted with
- X any modifiers or data functions; doing so will generate a syntax error
- X stating that the parametric function is not fully specified.
- X
- X Ranges take on a different meaning when in parametric mode. The first
- X range on the `plot` command is the `trange`, the next is the `xrange`,
- X and the last is the `yrange`. For `splot` the order is `urange`,
- X `vrange`, `xrange`, `yrange`, and finally `zrange`. The following
- X `plot` command shows setting the `trange` to [-pi:pi], the `xrange` to
- X [-1.3:1.3] and the `yrange` to [-1:1] for the duration of the plot:
- X plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
- X
- X Other modifiers, such as `with` and `title`, may be specified only
- X after the parametric function has been completed:
- X plot sin(t),t**2 title 'Parametric example' with linespoints
- X
- X
- X3 ranges
- X?splot ranges
- X?plot ranges
- X?ranges
- X The optional range specifies the region of the plot that will be
- X displayed.
- X
- X Ranges may be provided on the `plot` and `splot` command line and
- X affect only that plot, or in the `set xrange`, `set yrange`, etc.,
- X commands, to change the default ranges for future plots.
- X
- X Syntax:
- X [{<dummy-var> =} {<xmin> : <xmax>}] { [{<ymin> : <ymax>}] }
- X
- X where <dummy-var> is the independent variable (the defaults are x and
- X y, but this may be changed with `set dummy`) and the min and max
- X terms can be constant expressions.
- X
- X Both the min and max terms are optional. The ':' is also optional
- X if neither a min nor a max term is specified. This allows '[ ]' to
- X be used as a null range specification.
- X
- X Specifying a range in the `plot` command line turns autoscaling for
- X that axis off for that plot. Using one of the `set` range commands
- X turns autoscaling off for that axis for future plots, unless changed
- X later. (See `set autoscale`).
- X
- X Examples:
- X
- X This uses the current ranges:
- X plot cos(x)
- X
- X This sets the x range only:
- X plot [-10:30] sin(pi*x)/(pi*x)
- X
- X This is the same, but uses t as the dummy-variable:
- X plot [t = -10 :30] sin(pi*t)/(pi*t)
- X
- X This sets both the x and y ranges:
- X plot [-pi:pi] [-3:3] tan(x), 1/x
- X
- X This sets only the y range, and turns off autoscaling on both axes:
- X plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
- X
- X This sets xmax and ymin only:
- X plot [:200] [-pi:] exp(sin(x))
- X
- X This sets the x, y, and z ranges:
- X splot [0:3] [1:4] [-1:1] x*y
- X3 index
- X?splot index
- X?index
- X Splotting of multi mesh data files can be controlled via the index modifier.
- X A data file can contain more than one mesh, and in that case all meshes
- X in the file will be splotted by default. Meshes are separated from each
- X other, in the data file, by double blank lines. To splot a single mesh in
- X a multi mesh file use the index modifier which specify which mesh to splot.
- X First mesh is mesh 0.
- X
- X Example:
- X
- X splot "data1" index 2 with points
- X
- X will splot the third mesh in file data1 with points.
- X3 style
- X?plot style
- X?splot style
- X?style
- X?plot with
- X?with
- X Plots may be displayed in one of eight styles: `lines`, `points`,
- X `linespoints`, `impulses`, `dots`, `errorbars`, `steps`, `boxes`, or
- X `boxerrorbars`. The `lines` style connects adjacent points with lines.
- X The `points` style displays a small symbol at each point.
- X The `linespoints` style does both `lines` and `points`.
- X The `impulses` style displays a vertical line from the x axis
- X (or from the grid base for `splot`) to each point. The `dots` style
- X plots a tiny dot at each point; this is useful for
- X scatter plots with many points.
- X
- X The `errorbars` style is only relevant to 2-d data file plotting. It
- X is treated like `points` for `splot`s and function `plot`s. For data
- X `plot`s, `errorbars` is like `points`, except that a vertical error
- X bar is also drawn: for each point (x,y), a line is drawn from
- X (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
- X bar. The ylow and yhigh values are read from the data file's columns,
- X as specified with the `using` option to plot. See `plot errorbars` for
- X more information.
- X
- X The `boxes` style is only relevant to 2-d plotting. Another style
- X called `boxerrorbars` is also available and is only relevant to 2-d
- X data file plotting. This style is a combination of the `boxes` and
- X `errorbars` styles. The `boxes` style draws a box centred about
- X the given x coordinate from the yaxis to the given y coordinate.
- X The width of the box is obtained in one of three ways. First, if a
- X data file has a fifth column, this will be used to set the width of
- X the box. Columns 3 and 4 (for `boxerrorbars`) are necessary but
- X ignored in this instance. Secondly, if a width has been set using
- X the `set boxwidth` command, this will be used. Otherwise the width
- X of each box will be calculated automatically so that it touches the
- X adjacent boxes.
- X
- X The `steps` style is only relevant to 2-d plotting. This style
- X connects consecutive points with two line segments: the first
- X from (x1,y1) to (x2,y1) and the second from (x2,y1) to (x2,y2).
- X
- X Default styles are chosen with the `set function style` and
- X `set data style` commands.
- X
- X By default, each function and data file will use a different
- X line type and point type, up to the maximum number of available
- X types. All terminal drivers support at least six different point
- X types, and re-use them, in order, if more than six are required.
- X The LaTeX driver supplies an additional six point types (all variants
- X of a circle), and thus will only repeat after twelve curves are
- X plotted with points.
- X
- X If desired, the style and (optionally) the line type and point type
- X used for a curve can be specified.
- X
- X Syntax:
- X
- X with <style> {<linetype> {<pointtype>}}
- X
- X where <style> is either `lines`, `points`, `linespoints`, `impulses`,
- X `dots`, `steps`, or `errorbars`. The <linetype> and <pointtype> are
- X positive integer constants or expressions and specify the line type
- X and point type to be used for the plot. Line type 1 is the first line
- X type used by default, line type 2 is the second line type used by
- X default, etc.
- X
- X Examples:
- X
- X This plots sin(x) with impulses:
- X plot sin(x) with impulses
- X
- X This plots x*y with points, x**2 + y**2 default:
- X splot x*y w points, x**2 + y**2
- X
- X This plots tan(x) with the default function style, "data.1" with lines:
- X plot [ ] [-2:5] tan(x), "data.1" with l
- X
- X This plots "leastsq.dat" with impulses:
- X plot 'leastsq.dat' w i
- X
- X This plots the data file 'population' with boxes:
- X plot "population" with boxes
- X
- X This plots "exper.dat" with errorbars and lines connecting the points:
- X plot 'exper.dat' w lines, 'exper.dat' w errorbars
- X
- X Here 'exper.dat' should have three or four data columns.
- X
- X This plots x**2 + y**2 and x**2 - y**2 with the same line type:
- X splot x**2 + y**2 with line 1, x**2 - y**2 with line 1
- X
- X This plots sin(x) and cos(x) with linespoints, using the
- X same line type but different point types:
- X plot sin(x) with linesp 1 3, cos(x) with linesp 1 4
- X
- X This plots file "data" with points style 3:
- X plot "data" with points 1 3
- X Note that the line style must be specified when specifying the point
- X style, even when it is irrelevant. Here the line style is 1 and the
- X point style is 3, and the line style is irrelevant.
- X
- X See `set style` to change the default styles.
- X3 title
- X?plot title
- X?splot title
- X A title of each plot appears in the key. By default the title is
- X the function or file name as it appears on the plot command line.
- X The title can be changed by using the `title` option. This option
- X should precede any `with` option.
- X
- X Syntax:
- X title "<title>"
- X
- X where <title> is the new title of the plot and must be enclosed in
- X quotes. The quotes will not be shown in the key.
- X
- X Examples:
- X
- X This plots y=x with the title 'x':
- X plot x
- X
- X This plots the "glass.dat" file with the title 'surface of revolution':
- X splot "glass.dat" title 'surface of revolution'
- X
- X This plots x squared with title "x^2" and "data.1" with title
- X 'measured data':
- X plot x**2 title "x^2", "data.1" t 'measured data'
- X
- X The title can be omitted from the key with the "notitle" option for
- X plot and splot. This can be useful when some curves
- X are plotted solely for decoration; for example, if one wanted a
- X circular border for a polar plot, he could say:
- X
- X Example:
- X set polar
- X plot my_function(x), 1 notitle
- X
- X This would generate a key entry for "my_function" but not for "1".
- X See the poldat.dem example.
- X
- X
- X2 print
- X?print
- X The `print` command prints the value of <expression> to the screen.
- X
- X Syntax:
- X print <expression>
- X
- X See `expressions`.
- X2 pwd
- X?pwd
- X The `pwd` command prints the name of the working directory to the screen.
- X
- X Syntax:
- X pwd
- X2 quit
- X?quit
- X The `exit` and `quit` commands and END-OF-FILE character will exit
- X GNUPLOT. All these commands will clear the output device (as the
- X `clear` command does) before exiting.
- X2 replot
- X?replot
- X The `replot` command without arguments repeats the last `plot` or `splot`
- X command. This can be useful for viewing a plot with different `set`
- X options, or when generating the same plot for several devices.
- X
- X Arguments specified after a `replot` command will be added onto the last
- X `plot` (`splot`) command (with an implied ',' separator) before it is
- X repeated. `replot` accepts the same arguments as the `plot` (`splot`)
- X commands except that ranges cannot be specified.
- X See `command line-editing` for ways to edit the last `plot`
- X (`splot`) command.
- X2 reread
- X?reread
- X The `reread` command causes the current gnuplot command file, as specified
- X by a `load` command or on the command line, to be reset to its starting
- X point before further commands are read from it. This essentially implements
- X an endless loop of the commands from the beginning of the command file to
- X the `reread` command. The `reread` command has no effect if input from
- X standard input.
- X2 save
- X?save
- X The `save` command saves user-defined functions, variables, set
- X options or all three plus the last `plot` (`splot`) command to the
- X specified file.
- X
- X Syntax:
- X save {<option>} "<filename>"
- X
- X where <option> is `functions`, `variables` or `set`. If no option is
- X used, GNUPLOT saves functions, variables, set options and the last `plot`
- X (`splot`) command.
- X
- X `save`d files are written in text format and may be read by the `load`
- X command.
- X
- X The filename must be enclosed in quotes.
- X
- X Examples:
- X
- X save "work.gnu"
- X save functions 'func.dat'
- X save var 'var.dat'
- X save set "options.dat"
- X2 set-show
- X?set
- X?show
- X?show all
- X The `set` command sets LOTS of options.
- X
- X The `show` command shows their settings. `show all` shows all the
- X settings.
- X3 angles
- X?set angles
- X?show angles
- X?angles
- X?set angles degrees
- X By default, GNUPLOT assumes the independent variable in polar plots
- X is in units of radians. If `set angles degrees` is specified before
- X `set polar` then the default range is [0:360] and the independent
- X variable has units of degrees. This is particularly useful for
- X plots of data files. The angle setting also hold for the 3-d
- X mapping as set via the `set mapping` command.
- X
- X Syntax:
- X set angles { degrees | radians }
- X show angles
- X3 arrow
- X?set arrow
- X?set noarrow
- X?show arrow
- X?arrow
- X?noarrow
- X Arbitrary arrows can be placed on a plot using the `set arrow`
- X command.
- X
- X Syntax:
- X
- X set arrow {<tag>} {from <sx>,<sy>{,<sz>}}
- X {to <ex>,<ey>{,<ez>}} {{no}head}
- X set noarrow {<tag>}
- X show arrow
- X
- X
- X Unspecified coordinates default to 0. The x, y, and z values are in
- X the graph's coordinate system. The z coordinate is only used in
- X `splot` commands. <tag> is an integer that identifies the arrow. If no
- X tag is given, the lowest unused tag value is assigned automatically.
- X The tag can be used to delete or change a specific arrow. To change
- X any attribute of an existing arrow, use the `set arrow` command with
- X the appropriate tag, and specify the parts of the arrow to be
- X changed. Specifying nohead requests the arrow be drawn without a head
- X (yielding a line segment). By default, arrows have heads.
- X
- X Arrows outside the plotted boundaries are permitted but may cause
- X device errors.
- X
- X Examples:
- X
- X To set an arrow pointing from the origin to (1,2), use:
- X set arrow to 1,2
- X To set an arrow from (-10,4,2) to (-5,5,3), and tag the arrow number
- X 3, use:
- X set arrow 3 from -10,4,2 to -5,5,3
- X To change the preceding arrow begin at 1,1,1, without an arrow head,
- X use:
- X set arrow 3 from 1,1,1 nohead
- X To delete arrow number 2 use:
- X set noarrow 2
- X To delete all arrows use:
- X set noarrow
- X To show all arrows (in tag order) use:
- X show arrow
- X3 autoscale
- X?set autoscale
- X?set noautoscale
- X?show autoscale
- X?autoscale
- X?noautoscale
- X Auto scaling may be set individually on the x, y or z axis
- X or globally on all axes. The default is to autoscale all axes.
- X
- X When autoscaling, the plot range is automatically computed and the
- X dependent axis (y for a `plot` and z for `splot`) is scaled to
- X include the range of the function or data being plotted.
- X
- X If autoscaling of the dependent axis (y or z) is not set, the
- X current y or z range is used.
- X
- X See `set yrange` or `set zrange`.
- X
- X Autoscaling the independent variables (x for `plot` and x,y for
- X `splot`) is a request to set the domain to match any data file being
- X plotted. If there are no data files then autoscaling an independent
- X variable has no effect. In other words, in the absence of a data
- X file, functions alone do not affect the x range (or the y range if
- X plotting z = f(x,y)).
- X
- X See `set xrange`, or `set yrange`.
- X
- X The behavior of autoscaling remains consistent in parametric mode,
- X however, there are more dependent variables and hence more control
- X over x, y, and z plot scales. In parametric mode, the independent or
- X dummy variable is t for `plot`s and u,v for `splot`s. Autoscale in
- X parametric mode, then, controls all ranges (t, u, v, x, y, and z) and
- X allows x, y, and z to be fully autoscaled.
- X
- X See `set parametric`.
- X
- X Syntax:
- X set autoscale <axes>
- X set noautoscale <axes>
- X show autoscale
- X
- X where <axes> is either `x`, `y`, `z` or `xy`. If <axes> is not given
- X then all axes are assumed.
- X
- X Examples:
- X
- X This sets autoscaling of the y axis. x axis autoscaling is not
- X affected.
- X set autoscale y
- X
- X This sets autoscaling of the x and y axes.
- X set autoscale xy
- X
- X This sets autoscaling of the x, y and z axes.
- X set autoscale
- X
- X This disables autoscaling of the x, y and z axes.
- X set noautoscale
- X
- X This disables autoscaling of the z axis only.
- X set noautoscale z
- X4 parametric mode
- X?autoscale parametric
- X?set autoscale t
- X When in parametric mode (`set parametric`) the xrange is as
- X fully scalable as the yrange. In other words, in parametric
- X mode the x axis can be automatically scaled to fit the range
- X of the parametric function that is being plotted. Of course,
- X the y axis can also be automatically scaled just as in the
- X non-parametric case. If autoscaling on the x axis is not set,
- X the current x range is used.
- X
- X When there is a mix of data files and functions, the xrange of
- X the functions is selected as that of the data files if autoscale
- X is true for x. While this keeps the behavior compatible with
- X non-parametric plotting, it may not be retained in the future.
- X The problem is that, in parametric mode, the x and y ranges are
- X not as distinguishable as in the non-parametric mode and this
- X behavior may not be the most useful.
- X
- X For completeness a last command `set autoscale t` is accepted.
- X However, the effect of this "scaling" is very minor. When
- X GNUPLOT determines that the t range would be empty it makes a
- X small adjustment if autoscaling is true. Otherwise, GNUPLOT
- X gives an error. Such behavior may, in fact, not be very useful
- X and the command `set autoscale t` is certainly questionable.
- X
- X `splot` extends the above idea similarly. If autoscaling is set then
- X x, y, and z ranges are computed and each axis scaled to fit the
- X resulting data.
- X3 border
- X?set border
- X?set noborder
- X?show border
- X?border
- X?noborder
- X The `set border` and `set noborder` commands controls the display of
- X the plot borders for the `plot` and `splot` commands.
- X
- X Syntax:
- X set border
- X set noborder
- X show border
- X3 boxwidth
- X?set boxwidth
- X?show boxwidth
- X?boxwidth
- X The `set boxwidth` command is used to set the default width of
- X boxes in the `boxes` and `boxerrorbars` styles.
- X
- X If a data file is plotted without the width being specified in the
- X fifth column, or a function is plotted, the width of each box is
- X set by the `set boxwidth` command. If a width is given after the
- X `set boxwidth` command then this is used as the width. Otherwise
- X the width of each box will be calculated automatically so that
- X it touches the adjacent boxes.
- X
- X Syntax:
- X set boxwidth {<width>}
- X show boxwidth
- X
- X To set the box width to automatic use the command
- X set boxwidth
- X3 clabel
- X?set clabel
- X?set noclabel
- X?show clabel
- X?clabel
- X?noclabel
- X GNUPLOT will vary the linetype used for each contour level
- X when clabel is set. When this option on (the default), a
- X legend labels each linestyle with the z level it represents.
- X
- X Syntax:
- X set clabel
- X set noclabel
- X show clabel
- X3 clip
- X?set clip
- X?set noclip
- X?show clip
- X?clip
- X?noclip
- X GNUPLOT can clip data points and lines that are near the boundaries
- X of a plot.
- X
- X Syntax:
- X set clip <clip-type>
- X set noclip <clip-type>
- X show clip
- X
- X Three clip types are supported by GNUPLOT: `points`, `one`, and `two`.
- X One, two, or all three clip types may be active for a single plot.
- X
- X The `points` clip type forces GNUPLOT to clip (actually, not plot at
- X all) data points that fall within but too close to the boundaries
- X (this is so the large symbols used for points will not extend outside
- X the boundary lines). Without clipping points near the boundaries may
- X look bad; try adjusting the x and y ranges.
- X
- X Setting the `one` clip type causes GNUPLOT to plot the line segments
- X which have only one of the two endpoints within the plotting region.
- X Only the in-range portion of the line is drawn. The alternative is to
- X not draw any portion of the line segment.
- X
- X Some lines may have both endpoints out of range, but pass through the
- X plotting area. Setting the `two` clip-type allows the visible portion
- X of these lines to be drawn.
- X
- X In no case is a line drawn outside the plotting area.
- X
- X The defaults are `noclip points`, `clip one`, and `noclip two`.
- X
- X To check the state of all forms of clipping, use
- X show clip
- X
- X For backward compatibility with older versions, the following forms
- X are also permitted.
- X set clip
- X set noclip
- X `set clip` is synonymous with `set clip points`. `set noclip` turns
- X off all three types of clipping.
- X3 cntrparam
- X?set cntrparam
- X?show cntrparam
- X?cntrparam
- X Sets the different parameters for the contouring plot (see also `contour`).
- X
- X Syntax:
- X set cntrparam { { linear | cubicspline | bspline } |
- X points <n> |
- X order <n> |
- X levels { [ auto ] <n> |
- X discrete <z1>,<z2>, ... |
- X incremental {<start>, <incr>{, <end>} } }
- X
- X Examples:
- X set cntrparam bspline
- X set cntrparam points 7
- X set cntrparam order 10
- X set cntrparam levels auto 5 # 5 automatic levels
- X set cntrparam levels discrete .1,1/exp(1),.9 # 3 discrete at .1,.37,.9
- X set cntrparam levels incremental 0,.1,.4
- X # 5 incremental levels at 0, .1, .2, .3 and .4
- X set cntrparam levels 10
- X # sets n = 10 retaining current setting of auto, discr. and
- X # increment's start and increment value, while changing end
- X set cntrparam levels incremental 100,50
- X # set start = 100 and increment = 50, retaining n levels
- X
- X This command controls the way contours are plotted. <n> should be an
- X integral constant expression and <z1>, <z2> any constant expressions.
- X The parameters are:
- X
- X `linear`, `cubicspline`, `bspline` - Controls type of approximation or
- X interpolation. If `linear`, then the contours are drawn piecewise
- X linear, as extracted from the surface directly. If `cubicspline`, then
- X piecewise linear contours are interpolated to form a somewhat smoother
- X contours, but which may undulate. The third option is the uniform
- X `bspline`, which only approximates the piecewise linear data but is
- X guaranteed to be smoother.
- X
- X `points` - Eventually all drawings are done with piecewise linear
- X strokes. This number controls the number of points used to
- X approximate a curve. Relevant for `cubicspline` and `bspline` modes
- X only.
- X
- X `order` - Order of the bspline approximation to be used. The bigger this
- X order is, the smoother the resulting contour. (Of course, higher order
- X bspline curves will move further away from the original piecewise linear
- X data.) This option is relevant for `bspline` mode only. Allowed values are
- X integers in the range from 2 (linear) to 10.
- X
- X `levels` - Number of contour levels, 'n'. Selection of the levels is
- X controlled by 'auto' (default), 'discrete', and 'incremental'. For 'auto',
- X if the surface is bounded by zmin and zmax then contours will be
- X generated from zmin+dz to zmax-dz in steps of size dz, where
- X dz = (zmax - zmin) / (levels + 1). For 'discrete', contours will be
- X generated at z = z1, z2 ... as specified. The number of discrete levels
- X is limited to MAX_DISCRETE_LEVELS, defined in plot.h to be 30. If
- X 'incremental', contours are generated at <n> values of z beginning at
- X <start> and increasing by <increment>.
- X3 contour
- X?set contour
- X?show contour
- X?contour
- X Enable contour drawing for surfaces. This option is available for `splot`
- X only.
- X
- X Syntax:
- X set contour { base | surface | both }
- X set nocontour
- X
- X If no option is provided to `set contour`, the default is `base`.
- X The three options specify where to draw the contours: `base` draws
- X the contours on the grid base where the x/ytics are placed, `surface`
- X draws the contours on the surfaces themselves, and `both` draws the
- X contours on both the base and the surface.
- X
- X See also `set cntrparam` for the parameters that affect the drawing of
- X contours.
- X3 data style
- X?set data style
- X?show data style
- X?data style
- X The `set data style` command changes the default plotting style
- X for data plots.
- X
- X Syntax:
- X set data style
- X show data style
- X set data style <style-choice>
- X
- X In the first case, `set data style` returns the possible style
- X choices: `lines`, `points`, `linespoints`, `dots`, `steps`,
- X `impulses`, `errorbars`, `boxes` or `boxerrorbars`. `show data style`
- X shows the current default plotting style for data. `set data style dots`
- X would actually change the default plotting style. See also `plot`.
- X3 dgrid3d
- X?set dgrid3d
- X?show dgrid3d
- X?dgrid3d
- X Enables and sets the different parameters for non grid to grid data mapping.
- X
- X Syntax:
- X set dgrid3d {,{<row_size>}{,{<col_size>}{,<norm>}}}
- X set nodgrid3d
- X
- X Examples:
- X set dgrid3d 10,10,2
- X set dgrid3d ,,4
- X
- X The first selects a grid of size 10 by 10 to be constructed and the use
- X of L2 norm in the distance computation. The second only modifies the norm
- X to be used to L4.
- X
- X By default this option is disabled. When enabled, 3d data read from a file
- X is always treaded as a scattered data set. A grid with dimensions derived
- X from a bounding box of the scattered data and size as specified by the
- X row/col_size above is created for plotting and contouring. The grid is
- X equally spaced in x and y while the z value is computed as a weighted
- X average of the scattered points distance to the grid points. The closer
- X the scatter points to a grid point are the more effect they have on that
- X grid point. The third, norm, parameter controls the "meaning" of the
- X distance, by specifying the distance norm. This distance computation
- X is optimized for powers of 2 norms, specifically 1, 2, 4, 8, and 16, but
- X any nonnegative integer can be used.
- X
- X This dgrid3d option is a simple low pass filter that converts scattered data
- X to a grid data set. More sophisticated approaches to this problem exists and
- X should be used as a preprocess to and outside gnuplot if this simple solution
- X is found inadequate.
- X
- X3 dummy
- X?set dummy
- X?show dummy
- X?dummy
- X By default, GNUPLOT assumes that the independent variable for the
- X `plot` command is x, and the independent variables for the `splot`
- X command are x and y. They are called the dummy variables because it
- X is just a notation to indicate the independent variables.
- X The `set dummy` command changes these default dummy variable names.
- X For example, it may be more convenient to call the dummy variable t
- X when plotting time functions:
- X
- X set dummy t
- X plot sin(t), cos(t)
- X
- X Syntax:
- X set dummy <dummy-var>{,<dummy-var>}
- X show dummy
- X
- X Examples:
- X set dummy u,v
- X set dummy ,s
- X
- X to set both dummy variables to u and v or set only the second
- X variable to s.
- X
- X The `set parametric` command also changes the dummy variables (to t
- X for `plot` and u,v for `splot`s).
- X
- X3 format
- X?set format
- X?show format
- X?format
- X The format of the tic-mark labels can be set with the `set format`
- X command. The default format for both axes is "%g", but other formats
- X such as "%.2f" or "%3.0fm" are often desirable. Anything accepted by
- X printf when given a double precision number, and then accepted by the
- X terminal, will work. In particular, the formats f, e, and g will work,
- X and the d, o, x, c, s, and u formats will not work.
- X
- X Syntax:
- X set format {<axes>} {"<format-string>"}
- X show format
- X
- X where <axes> is either `x`, `y`, `z`, `xy`, or nothing (which is the
- X same as `xy`). The length of the string representing a ticmark (after
- X formatting with printf) is restricted to 100 characters. If the
- X format string is omitted, the format will be returned to the default
- X "%g". For LaTeX users, the format "$%g$" is often desirable. If the
- X empty string "" is used, no label will be plotted with each tic,
- X though the tic mark will still be plotted. To eliminate all tic marks,
- X use `set noxtics` or `set noytics`.
- X
- X See also `set xtics` and `set ytics` for more control over tic labels.
- X3 function style
- X?set function style
- X?show function style
- X?function style
- X The `set function style` command changes the default plotting style
- X for functions.
- X
- X Syntax:
- X set function style
- X show function style
- X set function style <style-choice>
- X
- X In the first case, `set function style` returns the possible style
- END_OF_FILE
- if test 66025 -ne `wc -c <'gnuplot/docs/gnuplot.doc.A'`; then
- echo shar: \"'gnuplot/docs/gnuplot.doc.A'\" unpacked with wrong size!
- elif test -f 'gnuplot/docs/gnuplot.doc.B' ; then
- echo shar: Combining \"'gnuplot/docs/gnuplot.doc'\" \(129941 characters\)
- cat 'gnuplot/docs/gnuplot.doc.A' 'gnuplot/docs/gnuplot.doc.B' > 'gnuplot/docs/gnuplot.doc'
- if test 129941 -ne `wc -c <'gnuplot/docs/gnuplot.doc'`; then
- echo shar: \"'gnuplot/docs/gnuplot.doc'\" combined with wrong size!
- else
- rm gnuplot/docs/gnuplot.doc.A gnuplot/docs/gnuplot.doc.B
- fi
- fi
- # end of 'gnuplot/docs/gnuplot.doc.A'
- fi
- if test -f 'gnuplot/term/post.trm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/term/post.trm'\"
- else
- echo shar: Extracting \"'gnuplot/term/post.trm'\" \(11386 characters\)
- sed "s/^X//" >'gnuplot/term/post.trm' <<'END_OF_FILE'
- X/*
- X * $Id: post.trm%v 3.50 1993/07/09 05:35:24 woo Exp $
- X */
- X
- X/* GNUPLOT - post.trm */
- X/*
- X * Copyright (C) 1990 - 1993
- 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 * This file is included by ../term.c.
- X *
- X * This terminal driver supports:
- X * postscript
- X *
- X * AUTHORS
- X * Russell Lang
- X *
- X * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
- X *
- X * The 'postscript' driver produces landscape output 10" wide and 7" high.
- X * To change font to Times-Roman and font size to 20pts use
- X * 'set term postscript "Times-Roman" 20'.
- X * To get a smaller (5" x 3.5") eps output use 'set term post eps'
- X * and make only one plot per file. Font size for eps will be half
- X * the specified size.
- X */
- X
- X
- X/* PostScript driver by Russell Lang, rjl@monu1.cc.monash.edu.au */
- X
- Xchar ps_font[MAX_ID_LEN+1] = "Helvetica" ; /* name of font */
- Xint ps_fontsize = 14; /* size of font in pts */
- XTBOOLEAN ps_portrait = FALSE; /* vertical page */
- XTBOOLEAN ps_color = FALSE;
- XTBOOLEAN ps_solid = FALSE; /* use solid lines */
- XTBOOLEAN ps_eps = FALSE; /* Is this for an eps file? */
- X /* Added by Robert Davis <davis@ecn.purdue.edu> */
- Xint ps_page=0; /* page count */
- Xint ps_path_count=0; /* count of lines in path */
- Xint ps_ang=0; /* text angle */
- Xenum JUSTIFY ps_justify=LEFT; /* text is flush left */
- X
- Xchar GPFAR * GPFAR PS_header[] = {
- X"/M {moveto} bind def\n",
- X"/L {lineto} bind def\n",
- X"/R {rmoveto} bind def\n",
- X"/V {rlineto} bind def\n",
- X"/vpt2 vpt 2 mul def\n",
- X"/hpt2 hpt 2 mul def\n",
- X/* flush left show */
- X"/Lshow { currentpoint stroke M\n",
- X" 0 vshift R show } def\n",
- X/* flush right show */
- X"/Rshow { currentpoint stroke M\n",
- X" dup stringwidth pop neg vshift R show } def\n",
- X/* centred show */
- X"/Cshow { currentpoint stroke M\n",
- X" dup stringwidth pop -2 div vshift R show } def\n",
- X/* Dash or Color Line */
- X"/DL { Color {setrgbcolor Solid {pop []} if 0 setdash }\n",
- X" {pop pop pop Solid {pop []} if 0 setdash} ifelse } def\n",
- X/* Border Lines */
- X"/BL { stroke gnulinewidth 2 mul setlinewidth } def\n",
- X/* Axes Lines */
- X"/AL { stroke gnulinewidth 2 div setlinewidth } def\n",
- X/* Plot Lines */
- X"/PL { stroke gnulinewidth setlinewidth } def\n",
- X/* Line Types */
- X"/LTb { BL [] 0 0 0 DL } def\n", /* border */
- X"/LTa { AL [1 dl 2 dl] 0 setdash 0 0 0 setrgbcolor } def\n", /* axes */
- X"/LT0 { PL [] 0 1 0 DL } def\n",
- X"/LT1 { PL [4 dl 2 dl] 0 0 1 DL } def\n",
- X"/LT2 { PL [2 dl 3 dl] 1 0 0 DL } def\n",
- X"/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def\n",
- X"/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def\n",
- X"/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def\n",
- X"/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def\n",
- X"/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def\n",
- X"/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def\n",
- X"/P { stroke [] 0 setdash\n", /* Point */
- X" currentlinewidth 2 div sub M\n",
- X" 0 currentlinewidth V stroke } def\n",
- X"/D { stroke [] 0 setdash 2 copy vpt add M\n", /* Diamond */
- X" hpt neg vpt neg V hpt vpt neg V\n",
- X" hpt vpt V hpt neg vpt V closepath stroke\n",
- X" P } def\n",
- X"/A { stroke [] 0 setdash vpt sub M 0 vpt2 V\n", /* Plus (Add) */
- X" currentpoint stroke M\n",
- X" hpt neg vpt neg R hpt2 0 V stroke\n",
- X" } def\n",
- X"/B { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M\n", /* Box */
- X" 0 vpt2 neg V hpt2 0 V 0 vpt2 V\n",
- X" hpt2 neg 0 V closepath stroke\n",
- X" P } def\n",
- X"/C { stroke [] 0 setdash exch hpt sub exch vpt add M\n", /* Cross */
- X" hpt2 vpt2 neg V currentpoint stroke M\n",
- X" hpt2 neg 0 R hpt2 vpt2 V stroke } def\n",
- X"/T { stroke [] 0 setdash 2 copy vpt 1.12 mul add M\n", /* Triangle */
- X" hpt neg vpt -1.62 mul V\n",
- X" hpt 2 mul 0 V\n",
- X" hpt neg vpt 1.62 mul V closepath stroke\n",
- X" P } def\n",
- X"/S { 2 copy A C} def\n", /* Star */
- XNULL
- X};
- X
- X#define PS_XOFF 50 /* page offset in pts */
- X#define PS_YOFF 50
- X
- X#define PS_XMAX 7200
- X#define PS_YMAX 5040
- X
- X#define PS_XLAST (PS_XMAX - 1)
- X#define PS_YLAST (PS_YMAX - 1)
- X
- X#define PS_VTIC (PS_YMAX/80)
- X#define PS_HTIC (PS_YMAX/80)
- X
- X#define PS_SC (10) /* scale is 1pt = 10 units */
- X#define PS_LW (0.5*PS_SC) /* linewidth = 0.5 pts */
- X
- X#define PS_VCHAR (14*PS_SC) /* default is 14 point characters */
- X#define PS_HCHAR (14*PS_SC*6/10)
- X
- Xint PS_pen_x, PS_pen_y;
- Xint PS_taken;
- Xint PS_linetype_last;
- XTBOOLEAN PS_relative_ok;
- X
- XPS_options()
- X{
- X extern struct value *const_express();
- X extern double real();
- X
- X if (!END_OF_COMMAND) {
- X if (almost_equals(c_token,"p$ortrait")) {
- X ps_portrait=TRUE;
- X ps_eps=FALSE;
- X c_token++;
- X }
- X else if (almost_equals(c_token,"l$andscape")) {
- X ps_portrait=FALSE;
- X ps_eps=FALSE;
- X c_token++;
- X }
- X else if (almost_equals(c_token,"e$psf")) {
- X ps_portrait=TRUE;
- X ps_eps = TRUE;
- X c_token++;
- X }
- X else if (almost_equals(c_token,"d$efault")) {
- X ps_portrait=FALSE;
- X ps_eps=FALSE;
- X ps_color=FALSE;
- X strcpy(ps_font,"Helvetica");
- X ps_fontsize = 14;
- X term_tbl[term].v_char = (unsigned int)(ps_fontsize*PS_SC);
- X term_tbl[term].h_char = (unsigned int)(ps_fontsize*PS_SC*6/10);
- X c_token++;
- X }
- X }
- X
- X if (!END_OF_COMMAND) {
- X if (almost_equals(c_token,"m$onochrome")) {
- X ps_color=FALSE;
- X c_token++;
- X }
- X else if (almost_equals(c_token,"c$olor")) {
- X ps_color=TRUE;
- X c_token++;
- X }
- X }
- X
- X if (!END_OF_COMMAND) {
- X if (almost_equals(c_token,"s$olid")) {
- X ps_solid=TRUE;
- X c_token++;
- X }
- X else if (almost_equals(c_token,"d$ashed")) {
- X ps_solid=FALSE;
- X c_token++;
- X }
- X }
- X
- X if (!END_OF_COMMAND && isstring(c_token)) {
- X quote_str(ps_font,c_token);
- X c_token++;
- X }
- X
- X if (!END_OF_COMMAND) {
- X /* We have font size specified */
- X struct value a;
- X ps_fontsize = (int)real(const_express(&a));
- X term_tbl[term].v_char = (unsigned int)(ps_fontsize*PS_SC);
- X term_tbl[term].h_char = (unsigned int)(ps_fontsize*PS_SC*6/10);
- X }
- X
- X sprintf(term_options,"%s %s %s \"%s\" %d",
- X ps_eps ? "eps" : (ps_portrait ? "portrait" : "landscape"),
- X ps_color ? "color" : "monochrome",
- X ps_solid ? "solid" : "dashed",
- X ps_font,ps_fontsize);
- X}
- X
- X
- XPS_init()
- X{
- Xstatic char GPFAR psi1[] = "%%%%Creator: gnuplot\n\
- X%%%%DocumentFonts: %s\n\
- X%%%%BoundingBox: %d %d ";
- Xstatic char GPFAR psi2[] = "%%%%EndComments\n\
- X/gnudict 40 dict def\ngnudict begin\n\
- X/Color %s def\n\
- X/Solid %s def\n\
- X/gnulinewidth %.3f def\n\
- X/vshift %d def\n\
- X/dl {%d mul} def\n\
- X/hpt %.1f def\n\
- X/vpt %.1f def\n";
- X
- Xstruct termentry *t = &term_tbl[term];
- Xint i;
- X ps_page = 0;
- X if (!ps_eps)
- X fprintf(outfile,"%%!PS-Adobe-2.0\n");
- X else
- X fprintf(outfile,"%%!PS-Adobe-2.0 EPSF-2.0\n");
- X fprintf(outfile, psi1, ps_font, PS_XOFF, PS_YOFF);
- X if (ps_portrait)
- X fprintf(outfile,"%d %d\n",
- X (int)(xsize*(ps_eps ? 0.5 : 1.0)*(PS_XMAX)/PS_SC+0.5+PS_XOFF),
- X (int)(ysize*(ps_eps ? 0.5 : 1.0)*(PS_YMAX)/PS_SC+0.5+PS_YOFF) );
- X else
- X fprintf(outfile,"%d %d\n",
- X (int)(ysize*(ps_eps ? 0.5 : 1.0)*(PS_YMAX)/PS_SC+0.5+PS_XOFF),
- X (int)(xsize*(ps_eps ? 0.5 : 1.0)*(PS_XMAX)/PS_SC+0.5+PS_YOFF) );
- X if (!ps_eps)
- X fprintf(outfile,"%%%%Pages: (atend)\n");
- X fprintf(outfile, psi2,
- X ps_color ? "true" : "false",
- X ps_solid ? "true" : "false",
- X PS_LW, /* line width */
- X (int)(t->v_char)/(-3), /* shift for vertical centring */
- X PS_SC, /* dash length */
- X PS_HTIC/2.0, /* half point width */
- X PS_VTIC/2.0); /* half point height */
- X
- X for ( i=0; PS_header[i] != NULL; i++)
- X fprintf(outfile,"%s",PS_header[i]);
- X fprintf(outfile,"end\n%%%%EndProlog\n");
- X}
- X
- X
- XPS_graphics()
- X{
- Xstatic char GPFAR psg1[] = "0 setgray\n/%s findfont %d scalefont setfont\nnewpath\n";
- Xstruct termentry *t = &term_tbl[term];
- X ps_page++;
- X if (!ps_eps)
- X fprintf(outfile,"%%%%Page: %d %d\n",ps_page,ps_page);
- X fprintf(outfile,"gnudict begin\ngsave\n");
- X fprintf(outfile,"%d %d translate\n",PS_XOFF,PS_YOFF);
- X fprintf(outfile,"%.3f %.3f scale\n", (ps_eps ? 0.5 : 1.0)/PS_SC,
- X (ps_eps ? 0.5 : 1.0)/PS_SC);
- X if (!ps_portrait) {
- X fprintf(outfile,"90 rotate\n0 %d translate\n", (int)(-PS_YMAX*ysize));
- X }
- X fprintf(outfile, psg1, ps_font, (t->v_char) );
- X ps_path_count = 0;
- X PS_relative_ok = FALSE;
- X PS_pen_x = PS_pen_y = -4000;
- X PS_taken = 0;
- X PS_linetype_last = -1;
- X}
- X
- X
- XPS_text()
- X{
- X ps_path_count = 0;
- X fprintf(outfile,"stroke\ngrestore\nend\nshowpage\n");
- X /* fprintf(stderr,"taken %d times\n",PS_taken); */
- X /* informational: tells how many times it was "cheaper"
- X to do a relative moveto or lineto rather than an
- X absolute one */
- X}
- X
- X
- XPS_reset()
- X{
- X fprintf(outfile,"%%%%Trailer\n");
- X if (!ps_eps)
- X fprintf(outfile,"%%%%Pages: %d\n",ps_page);
- X}
- X
- X
- XPS_linetype(linetype)
- Xint linetype;
- X{
- Xchar *line = "ba012345678";
- X linetype = (linetype % 9) + 2;
- X PS_relative_ok = FALSE;
- X if (PS_linetype_last == linetype) return(0);
- X PS_linetype_last = linetype;
- X fprintf(outfile,"LT%c\n", line[linetype]);
- X ps_path_count = 0;
- X}
- X
- X
- XPS_move(x,y)
- Xunsigned int x,y;
- X{
- X int dx, dy;
- X char abso[20],rel[20];
- X dx = x - PS_pen_x;
- X dy = y - PS_pen_y;
- X /* can't cancel all null moves--need a move after stroke'ing */
- X if (dx==0 && dy==0 && PS_relative_ok)
- X return(0);
- X sprintf(abso, "%d %d M\n", x, y);
- X sprintf(rel, "%d %d R\n", dx, dy);
- X if (strlen(rel) < strlen(abso) && PS_relative_ok){
- X fputs(rel, outfile);
- X PS_taken++;
- X }else
- X fputs(abso, outfile);
- X PS_relative_ok = TRUE;
- X ps_path_count += 1;
- X PS_pen_x = x;
- X PS_pen_y = y;
- X}
- X
- XPS_vector(x,y)
- Xunsigned int x,y;
- X{
- X int dx, dy;
- X char abso[20],rel[20];
- X dx = x - PS_pen_x;
- X dy = y - PS_pen_y;
- X if (dx==0 && dy==0) return(0);
- X sprintf(abso, "%d %d L\n", x, y);
- X sprintf(rel, "%d %d V\n", dx, dy);
- X if (strlen(rel) < strlen(abso) && PS_relative_ok){
- X fputs(rel, outfile);
- X PS_taken++;
- X }else
- X fputs(abso, outfile);
- X PS_relative_ok = TRUE;
- X ps_path_count += 1;
- X PS_pen_x = x;
- X PS_pen_y = y;
- X if (ps_path_count >= 400) {
- X fprintf(outfile,"currentpoint stroke M\n");
- X ps_path_count = 0;
- X }
- X}
- X
- X
- XPS_put_text(x,y,str)
- Xunsigned int x, y;
- Xchar *str;
- X{
- Xchar ch;
- X if (!strlen(str)) return(0);
- X PS_move(x,y);
- X if (ps_ang != 0)
- X fprintf(outfile,"currentpoint gsave translate %d rotate 0 0 M\n"
- X ,ps_ang*90);
- X putc('(',outfile);
- X ch = *str++;
- X while(ch!='\0') {
- X if ( (ch=='(') || (ch==')') || (ch=='\\') )
- X putc('\\',outfile);
- X putc(ch,outfile);
- X ch = *str++;
- X }
- X switch(ps_justify) {
- X case LEFT : fprintf(outfile,") Lshow\n");
- X break;
- X case CENTRE : fprintf(outfile,") Cshow\n");
- X break;
- X case RIGHT : fprintf(outfile,") Rshow\n");
- X break;
- X }
- X if (ps_ang != 0)
- X fprintf(outfile,"grestore\n");
- X ps_path_count = 0;
- X PS_relative_ok = FALSE;
- X}
- X
- Xint PS_text_angle(ang)
- Xint ang;
- X{
- X ps_ang=ang;
- X return TRUE;
- X}
- X
- Xint PS_justify_text(mode)
- Xenum JUSTIFY mode;
- X{
- X ps_justify=mode;
- X return TRUE;
- X}
- X
- X/* postscript point routines */
- XPS_point(x,y,number)
- Xint x,y;
- Xint number;
- X{
- Xchar *point = "PDABCTS";
- X number %= POINT_TYPES;
- X if (number < -1)
- X number = -1; /* negative types are all 'dot' */
- X fprintf(outfile,"%d %d %c\n", x, y, point[number+1]);
- X PS_relative_ok = 0;
- X ps_path_count = 0;
- X PS_linetype_last = -1; /* force next linetype change */
- X}
- X
- END_OF_FILE
- if test 11386 -ne `wc -c <'gnuplot/term/post.trm'`; then
- echo shar: \"'gnuplot/term/post.trm'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/term/post.trm'
- fi
- echo shar: End of archive 3 \(of 33\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 33 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-