home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-25 | 51.4 KB | 1,469 lines |
- Newsgroups: comp.sources.misc
- organization: Pixar -- Marin County, California
- subject: v11i068: Gnuplot 2.0 - 3 of 14
- From: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 11, Issue 68
- Submitted-by: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Archive-name: gnuplot2/part03
-
- This is gnuplot.sh03
-
- --- CUT HERE ---
- #! /bin/sh
- echo x - docs/gnuplot.doc
- sed 's/^X//' >docs/gnuplot.doc <<'*-*-END-of-docs/gnuplot.doc-*-*'
- X1 gnuplot
- X?
- X GNUPLOT is a command-driven interactive function plotting program. It
- X 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
- X Any command-line arguments are assumed to be names of files containing
- X gnuplot commands. Each file is loaded with the `load` command, in the
- X order specified. Gnuplot exits after the last file is processed.
- 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 (see `comment`).
- X
- X In this documentation, curly braces ({}) denote optional arguments to
- X many commands.
- X
- X For help on any topic, type 'help' followed by the name of the topic.
- 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 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 affect 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 help start-up), and of course by later explicit changes.
- X
- X On Unix and MS-DOS, GNUHELP may be defined to be the pathname of the
- X 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 a
- X .gnuplot file if none is found in the current directory.
- X On MS-DOS, GNUPLOT is used. On VMS, SYS$LOGIN: is used.
- X See help start-up.
- X
- X On Unix, PAGER is used as an output filter for help messages. SHELL
- X is used for the `shell` command.
- X
- X On MS-DOS, COMSPEC is used for the `shell` command.
- X2 exit
- X?exit
- X?quit
- X The commands `exit` and `quit` and your computer's 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{real (x) sup 2 + 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 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 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 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 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 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$. $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
- X a subtopic may be requested by typing its name, extending the help
- X request. After that subtopic has been printed, you may extend the
- X request again, as before, or go back one level to the previous topic,
- X by simply pressing return without typing anything. Eventually, you
- X will return to the GNUPLOT command line.
- 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 Pause is useful in conjunction with `load` files. The command `pause`
- X displays any text associated with the command and then waits the
- X specified amount of time. This allows one to build a `load` file
- X and control the amount of time a finished graph is displayed. The
- X first argument is an expression that can be -1, 0, or a positive
- X integer. Choosing -1 will wait until a carriage return is hit. Zero (0)
- X won't pause at all, and a positive integer (such as 1 or 15) will
- X 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
- X Syntax:
- X pause <expression> {"string"}
- X Note the string is optional, and if present must be enclosed in quotes.
- X2 plot
- X?plot
- X `plot` is the primary command of the program. It plots functions and
- X data in many, many ways. The full syntax of this command is:
- X
- X plot {ranges} <function> {title} {style} {, <function> {title} {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
- X may also 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:10] [-pi:pi*2] tan(t),"data.1" with lines,t**2 with points
- X3 data-file
- X?plot datafile
- X?plot data-file
- X?datafile
- 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
- X line.
- X
- X Data files should contain one data point per line. A data point may
- X be specified either as an X and Y value separated by blank space, or
- X as just the Y value, in which case the program will use the number
- X of the coordinate as the X value. Coordinate numbers start at 0
- X and are incremented for each data point read. Lines beginning with #
- X (or ! on VMS) will be treated as comments and ignored.
- X
- X NOTE that blank lines cause a break in the input, and if the plot
- X style is `lines` or `linespoints` (see `plot style`) there will be no
- X line drawn between the preceding and following points. This does not
- X change the plot style, as would plotting 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
- X3 ranges
- X?plot ranges
- X?ranges
- X The optional range specifies the region of the plot which will be displayed.
- X
- X Ranges may be provided on the `plot` command line and affect only
- X that plot, or in the `set xrange` and `set yrange` commands, to
- X 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 default is `x`,
- X but this may be changed with the `set dummy` command) and the min
- X and max terms can be expressions or constants.
- 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
- X Examples:
- X
- X This uses current ranges:
- X plot cos(x)
- X
- X This sets the xrange 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 yranges:
- X plot [-pi:pi] [-3:3] tan(x), 1/x
- X
- X This sets only the yrange:
- 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))
- X3 style
- X?plot style
- X?style
- X Plots may be displayed in one of four 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 does both `lines` and
- X `points`. The `impulses` style displays a vertical line from the X
- X axis to each point. The `dots` style plots a tiny dot at each point;
- X this is useful for scatter plots with many points.
- 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 actual line type and point type used for a plot can
- X be specified. Syntax:
- X
- X with <style> {<linetype> {<pointtype>}}
- X
- X Where <style> is either `lines`, `points`, `linespoints`, `impulses`,
- X or `dots`. These keywords may be abbreviated.
- X Curly braces denote optional items. The <linetype> and <pointtype>
- X are positive integers, and specify the line type and point type to
- X be used for the plot. Line type 1 is the first line type used by
- X default, line type 2 is the second line type used by default etc.
- X
- X Examples:
- X
- X This plots sin(x) with impulses:
- X plot sin(x) with impulses
- X
- X This plots sin(x) with points, cos(x) default:
- X plot [-9:30] sin(x) w points, cos(x)
- 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 sin(x) and cos(x) with the same line type:
- X plot sin(x) with line 1, cos(x) 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 in order to specify the
- X point style, even when it is irrelevant. Here the line style is 1 and
- X the point style is 3, and the line style is irrelevant.
- X3 title
- X?plot 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.
- X
- X Examples:
- X
- X This plots y=x with the title 'x':
- X plot x
- X
- X This plots y=x with the title 'y=x':
- X plot x title 'y=x'
- X
- X This plots x squared with title 'x^2' and "data.1" with title 'measured data':
- X plot x**2 title "x^2", "data.1" t 'measured data'
- 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 quit
- X?quit
- X The `exit` and `quit` commands and your computer's END-OF-FILE
- X character will exit GNUPLOT. All these commands will clear the
- X output device (as the `clear` command does) before exiting.
- X2 replot
- X?replot
- X The `replot` command without arguments repeats the last `plot` command.
- X This can be useful for viewing a plot with different `set` options,
- X 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` command (with an implied ',' separator) before it is repeated.
- X `replot` accepts the same arguments as the `plot` command except that
- X ranges cannot be specified.
- X2 save
- X?save
- X The `save` command saves user-defined functions, variables, set
- X options or all three plus the last plot command to the 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 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 The `set` command sets LOTS of options.
- X
- X The `show` command shows their settings. `show all` shows all the
- X settings.
- X3 arrow
- X?set arrow
- X?set noarrow
- X?show arrow
- X?arrow
- X?noarrow
- X Arbitrary arrows can be placed on the plot using the `set arrow`
- X command.
- X
- X Syntax:
- X
- X set arrow {tag} {from sx,sy} {to ex,ey}
- X set noarrow {tag}
- X show arrow
- X
- X
- X Curly braces {} denote optional items.
- X All positions x,y default to 0,0.
- X The x and y values are in the graph's coordinate system.
- X The tag is an integer that is used to identify the arrow.
- X If no tag is given, the lowest unused tag value is assigned
- X automatically. The tag can be used to delete or change a specific
- X arrow. To change any attribute of an existing arrow, use the `set
- X arrow` command with the appropriate tag, and specify the parts of the
- X arrow to be changed.
- X
- X Arrows outside the plotted boundaries are permitted but may cause
- X device errors; use at your own risk.
- 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) to (-5,5), and tag the arrow number 3, use:
- X set arrow 3 from -10,4 to -5,5
- X To change the preceding arrow begin at 1,1, use
- X set arrow 3 from 1,1
- 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?show autoscale
- X?autoscale
- X Auto scaling may be set on the X and/or Y axis. The default is to
- X autoscale both axes.
- X
- X If autoscaling of the Y axis is set, the Y axis is automatically scaled
- X to fit the range of the function or data being plotted. If autoscaling
- X of the Y axis is not set, the current Y range is used. See `set yrange`.
- X
- X If autoscaling of the X axis is set, the X axis is automatically scaled
- X to fit the range of the data being plotted. Autoscaling of the X axis
- X will operate only on data. Functions do not affect the X range and the
- X range used for functions is determined by the data plots.
- X See `set xrange`.
- X
- X Syntax:
- X set autoscale <axes>
- X set noautoscale <axes>
- X show autoscale
- X
- X where <axes> is either `x`, `y`, or `xy`.
- X If <axes> is not given then both axes are assumed.
- X
- X Examples:
- X
- X These set autoscaling of the Y axis. X axis autoscaling not affected.
- X set autoscale y
- X
- X This sets autoscaling of the X and Y axes.
- X set autoscale xy
- X set autoscale
- X
- X This disables autoscaling of the X and Y axes.
- X set noautoscale
- X
- X This disables autoscaling of the X axis only.
- X set noautoscale x
- X3 clip
- X?set clip
- X?set noclip
- X?show clip
- X?clip
- X?noclip
- X GNUPLOT can clip (actually, not plot at all) data points that fall
- X within but too close to the boundaries (this is so the large symbols
- X used for points will not extend outside the boundary lines). To turn
- X on clipping, use `set clip points`. To turn it back off, use `set
- X noclip points`. The default is `noclip`. Without clipping you may have
- X points near the boundaries that look bad; try adjusting the x and y ranges.
- X
- X Syntax:
- X set clip points
- X set noclip points
- X
- X GNUPLOT can also clip lines that connect a point that is in range
- X with a point that is out of range. The default is to draw the
- X in-range portion of such lines (i.e., to "clip" them). With the
- X following syntax, the default is `set clip one`. The alternative
- X (`set noclip one`) is to not draw any portion of the line segment. In
- X no case is a line drawn outside the plotting area.
- X
- X Syntax:
- X set clip one
- X set noclip one
- X
- X GNUPLOT does not show lines that are wholly out of range. Some lines
- X may have both endpoints out of range, but pass through the plotting
- X area. By default, GNUPLOT does not draw these lines (`set noclip
- X two`). They may be drawn (and clipped) with `set clip two`.
- X
- X Syntax:
- X set clip two
- X set noclip two
- X
- X To check the state of all forms of clipping, use
- X show clip
- X
- X The following forms are also permitted. These allow backward
- X compatibility with older versions.
- 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 (`points`, `one`, and `two`).
- X3 dummy
- X?set dummy
- X?show dummy
- X?dummy
- X By default, GNUPLOT assumes that the independent variable for
- X the `plot` command line is `x`. `x` is called the dummy variable because
- X it is just a notation to indicate the independent variable. The
- X `set dummy` command changes this default dummy variable name. For
- X example, you may find it more convenient to call the dummy variable
- X `t` when plotting time functions:
- X
- X set dummy t
- X plot sin(t), cos(t)
- X
- X Syntax:
- X set dummy <dummy-var>
- X show dummy
- 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`, `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 If the format string is omitted, the format will be returned to
- X the default "%g". For LaTeX users, the format "$%g$" is often desirable.
- X If the empty string "" is used, no label will be plotted with each
- X tic, though the tic mark will still be plotted. To eliminate all tic
- X marks, use `set noxtics` or `set noytics`.
- X
- X See also `set xtics` and `set ytics` for more control over tic labels.
- X3 functions
- X?show functions
- X The `show functions` command lists all user-defined functions and
- X their definitions.
- X
- X Syntax:
- X show functions
- X3 grid
- X?set grid
- X?show grid
- X?grid
- X The optional `set grid` draws a grid at the tic marks with the axis
- X linetype.
- X
- X Syntax:
- X set grid
- X set nogrid
- X show grid
- X3 key
- X?set key
- X?show key
- X?key
- X The `set key` enables a key describing curves on a plot.
- X By default the key is placed in the upper right corner of
- X the plot.
- X
- X Syntax:
- X set key
- X set key x,y
- X set nokey
- X show key
- X
- X The coordinates x,y specify the location of the key on the plot.
- X The key is drawn as a sequence of lines, with one plot described
- X on each line. On the right hand side of each line is a
- X representation that attempts to mimic the way the curve is plotted.
- X On the left side of each line is the text description,
- X obtained from the `plot` 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
- X line that you specify with the optional x in the `set key`
- X command; the y in the `set key` command is top of the key.
- X Some or all of the key may be outside of the plot boundary, if you
- X wish, although this may interfere with other labels and may cause an
- X error on some devices.
- X
- X Examples:
- X
- X This places the key at the default location:
- X set key
- X This disables the key.
- X set nokey
- X This places a key at coordinates 2,3.5
- X set key 2,3.5
- X3 label
- X?set label
- X?set nolabel
- X?show label
- X?label
- X?nolabel
- X Arbitrary labels can be placed on the plot using the `set label`
- X command.
- X
- X Syntax:
- X
- X set label {tag} {"label_text"} {at x,y} {<justification>}
- X set nolabel {tag}
- X show label
- X
- X
- X Curly braces {} denote optional items.
- X The text defaults to "", and the position x,y to 0,0.
- X The x and y values are in the graph's coordinate system.
- X The tag is an integer that is used to identify the label.
- X If no tag is given, the lowest unused tag value is assigned
- X automatically. The tag can be used to delete or change a specific
- X label. To change any attribute of an existing label, use the `set
- X label` command with the appropriate tag, and specify the parts of the
- X label to be changed.
- X
- X By default, the text is placed flush left against point x,y. If you
- X want to adjust the way the label is positioned with respect to the
- X point x,y, add the parameter <justification>, which may be `left`,
- X `right` or `center`, indicating that the point is to be at the left,
- X right or center of the text. The <justification> may be abbreviated.
- X Labels outside the plotted boundaries are permitted but may interfere
- X with axes labels or other text; use at your own risk.
- X
- X Examples:
- X
- X To set a label at (1,2) to "y=x" use:
- X set label "y=x" at 1,2
- X To set a label "y=x^2" with the right of the text at (2,3), and tag
- X the label number 3, use:
- X set label 3 "y=x^2" at 2,3 right
- X To change the preceding label to center justification, use:
- X set label 3 center
- X To delete label number 2 use:
- X set nolabel 2
- X To delete all labels use:
- X set nolabel
- X To show all labels (in tag order) use:
- X show label
- X
- X The Imagen driver allows \\ in a string to specify a newline.
- X3 logscale
- X?set logscale
- X?set nologscale
- X?show logscale
- X?logscale
- X?nologscale
- X Log scaling may be set on the X and/or Y axis.
- X
- X Syntax:
- X set logscale <axes>
- X set nologscale <axes>
- X show logscale
- X
- X Where <axes> is either `x`, `y`, or `xy`.
- X If <axes> is not given then both axes are assumed.
- X The command `set logscale` turns on log scaling on the specified
- X axes, while `set nologscale` turns off log scaling.
- X3 offsets
- X?set offsets
- X?show offsets
- X?offsets
- X The amount of the graph that the plot takes up may be controlled
- X to some extent with the `set offsets` command. This command takes
- X four offset arguments -- <left>, <right>, <top> and <bottom>.
- X By default, each offset is 0. Each offest may be a constant or
- X an expression. Left and right offsets are given in units of
- X the x axis, while top and bottom offsets are given in units of
- X the y axis. The plot of sin(x), displayed with offsets of
- X 0, 0, 2, 2 will take up 1/3 of the displayed y axis.
- X Offsets are particularly useful with polar coordinates as a means
- X of compensating for aspect ratio distortion.
- X
- X Syntax:
- X set offsets <left>, <right>, <top>, <bottom>
- X show offsets
- X3 output
- X?set output
- X?show output
- X?output
- X By default, plots are displayed to the standard output. The
- X `set output` command redirects the display to the specified file or
- X device.
- X
- X Syntax:
- X set output {<filename>}
- X show output
- X
- X The filename must be enclosed in quotes. If the filename is
- X omitted, output will be sent to the standard output.
- X3 polar
- X?set polar
- X?show polar
- X?polar
- X The `set polar` command changes the meaning of the plot from
- X rectangular coordinates to polar coordinates. In polar
- X coordinates, the dummy variable (x) is an angle. The range
- X of this angle is changed from whatever it was to [0:2*pi].
- X
- X The command `set nopolar` changes the meaning of the plot back
- X to the default rectangular coordinate system. The range of
- X x is changed from whatever it was to [-10:10].
- X
- X While in polar coordinates the meaning of an expression in x
- X is really r = f(x), where x is an angle of rotation. The xrange
- X controls the domain (the angle) of the function, and the yrange
- X controls the range (the radius). The plot is plotted on a rectangular
- X grid, and the `x` and `y` axes are both in units of the radius. Thus,
- X the yrange controls both dimensions of the plot output. There is no
- X way to specify the output dimensions separately.
- X
- X Syntax:
- X set polar
- X set nopolar
- X show polar
- X Example:
- X set polar
- X plot x*sin(x)
- X plot [-2*pi:2*pi] [-3:3] x*sin(x)
- X The first plot uses the default polar angular domain of 0 to 2*pi.
- X The radius (and the size of the plot) is scaled automatically. The
- X second plot expands the domain, and restricts the range of the radius
- X (and the size of the plot) to [-3:3].
- X3 samples
- X?set samples
- X?show samples
- X?samples
- X The sampling rate of functions may be changed by the `set samples`
- X command. By default, sampling is set to 160 points. A higher
- X sampling rate will produce more accurate plots, but will take
- X longer. When plotting datafiles, the sampling rate must be set
- X higher than the number of data points.
- X
- X Syntax:
- X set samples <expression>
- X show samples
- X3 size
- X?set size
- X?show size
- X?size
- X The `set size` command scales the displayed size of the plot.
- X On some terminals, changing the size of the plot will result in
- X text being misplaced. Increasing the size of the plot may
- X produce strange results. Decreasing is safer.
- X
- X Syntax:
- X
- X set size {x,y}
- X show size
- X
- X The x and y values are the scaling factors for the size.
- X The defaults (1,1) are selected if the scaling factors are omitted.
- X
- X Examples:
- X
- X To set the size to normal size use:
- X set size
- X To make the plot half size use:
- X set size 0.5,0.5
- X To show the size use:
- X show size
- X
- X For the LaTeX and Fig terminals the default size (scale factor 1,1)
- X is 5 inches wide by 3 inches high. Note that the size of the plot
- X includes the space used by the labels; the plotting area itself is
- X smaller.
- X3 style
- X?set style
- X?show style
- X?style
- X Plots may be displayed in one of five 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 does both `lines` and
- X `points`. The `impulses` style displays a vertical line from the X
- X axis to each point. The `dots` style plots a tiny dot at each data
- X point; this is useful for scatter plots with many points.
- X
- X Default styles are chosen with the `set function style` and `set
- X data style` commands. See `plot style` for information about how
- X to override the default plotting style for individual functions.
- X
- X Syntax:
- X set function style <style>
- X set data style <style>
- X show function style
- X show data style
- X
- X Where <style> is either `lines`, `points`, `linespoints`, `impulses`,
- X or `dots`.
- X3 terminal
- X?set terminal
- X?show terminal
- X?terminal
- X GNUPLOT supports many different graphics devices. Use the `set
- X terminal` command to select the type of device for which GNUPLOT
- X will produce output.
- X
- X Syntax:
- X set terminal {<terminal-type>}
- X show terminal
- X
- X If <terminal-type> is omitted, GNUPLOT will list the available
- X terminal types. <terminal-type> may be abbreviated.
- X
- X Use `set output` to redirect this output to a file or device.
- X3 tics
- X?set tics
- X?show tics
- X?tics
- X By default, tics are drawn inwards from the border on all four sides.
- X The `set tics` command can be used to change the tics to be
- X drawn outwards on the left and bottom borders only.
- X This is useful when doing impulse plots.
- X
- X Syntax:
- X set tics {<direction>}
- X show tics
- X
- X Where <direction> may be `in`, `out` or nothing (which is the same as in).
- X
- X See also the `set xtics` and `set ytics` command for more control of
- X tic marks.
- X3 title
- X?set title
- X?show title
- X?title
- X The `set title` command sets the title which will be centered
- X at the top of the plot.
- X
- X Syntax:
- X set title
- X set title "title-text"
- X show title
- X
- X The first clears the title (default).
- X The second form sets the title to "title-text" (without the quotes).
- X
- X The Imagen driver allows \\ in a string to specify a newline.
- X3 variables
- X?show variables
- X The `show variables` command lists all user-defined variables and
- X their values.
- X
- X Syntax:
- X show variables
- X3 xlabel
- X?set xlabel
- X?show xlabel
- X?xlabel
- X The `set xlabel` command sets the x-axis label which will be centered
- X at the bottom of the plot.
- X
- X Syntax:
- X set xlabel
- X set xlabel "label"
- X show xlabel
- X
- X The first clears the x-axis label (default).
- X The second form sets the x-axis label to "label" (without the quotes).
- X
- X The Imagen driver allows \\ in a string to specify a newline.
- X3 xrange
- X?set xrange
- X?show xrange
- X?xrange
- X The `set xrange` command sets the horizontal range which will be
- X displayed. This command turns X axis autoscaling OFF.
- X
- X This range may also be specified on the `plot` command line.
- X
- X Syntax:
- X 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. Anything omitted will
- X not be changed, so
- X set xrange [:10]
- X changes xmax to 10 without affecting xmin.
- X3 xtics
- X?set xtics
- X?set noxtics
- X?show xtics
- X?xtics
- X?noxtics
- X Very fine control of the `x` axes tic marks is possible with the `set
- X xtics` and `set noxtics` command. The x-axis tic marks may be turned
- X off with the `set noxtics` command. They may be turned on (the
- X default state) with `set xtics`.
- X
- X If you prefer your own series of tic marks, you may use the form
- X set xtics <start>, <incr>{, <end>}
- X The curly braces indicate that the <end> parameter is optional.
- X This command specifies that a series of tics will be plotted on the
- X `x` axis between the `x` values <start> and <end> with an increment
- X of <incr>. If <end> is not given it is assumed to be infinity. The
- X increment may be negative. Example:
- X set xtics 0,.5,10
- X makes tics 0, 0.5, 1, 1.5, ..., 9.5, 10.
- X
- X If you need arbitrary tic positions, or non-numeric tic labels,
- X any non-empty set of tic positions and labels may be given with this
- X format:
- X set xtics ({"label"} pos {, {"label"} pos}...)
- X Again curly braces contain optional components. Thus, a set of tics
- X are a set of positions, each with its own optional label. Note that
- X the label is a string enclosed by quotes, and may be a constant
- X string, such as "hello", or contain formatting information for the tic
- X number (which is the same as the position), such as "%3f clients".
- X See `set format` for more information about this case. The label may
- X even be empty. Examples:
- X set xtics ("low" 0, "medium" 50, "high" 100)
- X set xtics (1,2,4,8,16,32,64,128,256,512,1024)
- X set xtics ("bottom" 0, "" 10, "top" 20)
- X
- X Tics will only be plotted when in range.
- X
- X The `set ytics` and `set noytics` commands work identically.
- X See also `set format` command.
- X3 ylabel
- X?set ylabel
- X?show ylabel
- X?ylabel
- X The `set ylabel` command sets the y-axis label.
- X The position of this label depends on the terminal, and can be
- X one of the following three positions.
- X
- X 1. Horizontal text flushed left at the top left of the plot.
- X Terminals that cannot rotate text will probably use this method.
- X
- X 2. Vertical text centered vertically at the left of the plot.
- X Terminals that can rotate text will probably use this method.
- X
- X 3. Horizontal text centered vertically at the left of the plot.
- X The Latex and EEPIC drivers use this method. The user must insert
- X line breaks using \\ to prevent the ylabel from overwriting
- X the plot. To produce a vertical row of characters, add \\
- X between every printing character.
- X
- X Syntax:
- X set ylabel
- X set ylabel "label"
- X show ylabel
- X
- X The first clears the y-axis label (default).
- X The second form sets the y-axis label to "label" (without the quotes).
- X
- X The Latex, EEPIC, and Imagen drivers allow \\ in a string to specify
- X a newline.
- X3 yrange
- X?set yrange
- X?show yrange
- X?yrange
- X The `set yrange` command sets the vertical range which will be
- X displayed. This command turns Y axis autoscaling OFF.
- X
- X This range may also be specified on the `plot` command line.
- X
- X Syntax:
- X 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. Anything omitted will
- X not be changed, so
- X set yrange [:10]
- X changes ymax to 10 without affecting ymin.
- X3 ytics
- X?set ytics
- X?set noytics
- X?show ytics
- X?ytics
- X?noytics
- X The `set ytics` and `set noytics` commands are similar to the `set xtics`
- X and `set noxtics` commands. Please see `set xtics`.
- X3 zero
- X?set zero
- X?show zero
- X?zero
- X GNUPLOT will not plot a point if its imaginary part is greater in
- X magnitude than the `zero` threshold. The default `zero` value is
- X 1e-8. This can be changed with the `set zero` command.
- X
- X Syntax:
- X set zero <expression>
- X show zero
- X2 shell
- X?shell
- X The `shell` command spawns an interactive shell. To return to
- X GNUPLOT, type `logout` if using VMS, `exit` or your END-OF-FILE
- X character if using Unix, or `exit` if using MS-DOS.
- X
- X A single shell command may be spawned by preceding it with the !
- X character ($ if using VMS) at the beginning of a command line.
- X Control will return immediately to GNUPLOT after this command is
- X executed. For example,
- X
- X ! dir
- X
- X prints a directory listing and then returns to GNUPLOT.
- X2 start-up
- X?startup
- X?start
- X?.gnuplot
- X When GNUPLOT is run, it looks for an initialization file to load.
- X This file is called `.gnuplot` on Unix systems, and `GNUPLOT.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 GNUPLOT should contain the name of this
- X directory).
- X
- X If this file is found, GNUPLOT 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.
- X2 substitution
- X?substitution
- X Command-line substitution 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 GNUPLOT command
- X line.
- X
- X
- X Example:
- X
- X This will run the program `leastsq` and substitute `leastsq`
- X (including quotes) on the command line with its output:
- X
- X f(x) = `leastsq`
- X
- X or, in VMS
- X
- X f(x) = `run leastsq`
- X2 user-defined
- X?userdefined
- X?variables
- X You may define your own functions and variables. User-defined
- X functions and 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`.
- X2 bugs
- X?bugs
- X The atan() function does not work correctly for complex arguments.
- X
- X The most important known bug is actually in the stdio library for the
- X Sun4 operating system (SunOS Sys4-3.2). The "%g" format for `printf`
- X sometimes incorrectly prints numbers (e.g., 200000.0 as "2"). Thus,
- X tic mark labels may be incorrect on a Sun4 version of gnuplot. You
- X may work around it by rescaling your data or by using the `set format`
- X command to change the tic mark format to "%7.0f" or some other
- X appropriate format. This appears to have been fixed in SunOS 4.0.
- X
- X Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
- X and SunOS 4.0, the `sscanf` routine incorrectly parses "00 12" with
- X the format "%f %f" and reads 0 and 0 instead of 0 and 12. This
- X affects data input. If your data file contains X coordinates that are
- X zero but are specified like '00', '000', etc, then you will read the
- X wrong Y values. Check your data files or do not use a Sun4 until they
- X fix the bug. It does NOT appear that this has been fixed in SunOS 4.0.
- X
- X Microsoft C 5.1 has a nasty bug associated with the %g format for
- X printf. When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are
- X used, printf will incorrectly print numbers in the range 1e-4 to 1e-1.
- X Numbers that should be printed in the %e format are incorrectly
- X printed in the %f format, with the wrong number of zeros after the
- X decimal point.
- X To work around this problem, use the %e or %f formats explicitly.
- X
- X Gnuplot when compiled with Microsoft C did not work correctly on two
- X VGA displays that were tested. The CGA, EGA and VGA drivers should
- X probably be rewritten to use the Microsoft C graphics library.
- X Gnuplot compiled with Turbo C uses the Turbo C graphics drivers and
- X does work correctly with VGA displays.
- X
- X VAX/VMS 4.7 C compiler release 2.4 also has a poorly implemented %g
- X format for printf. The numbers are printed numerically correct, but
- X may not be in the requested format. The K&R second edition says that
- X for the %g format, %e is used if the exponent is less than -4 or greater
- X than or equal to the precision. The VAX uses %e format if the exponent
- X is less than -1. The VAX appears to take no notice of the precision
- X when deciding whether to use %e or %f for numbers less than 1.
- X To work around this problem, use the %e or %f formats explicitly.
- X From the VAX C 2.4 release notes:
- X e,E,f,F,g,G Result will always contain a decimal point.
- X For g and G, trailing zeros will not be removed from the result.
- X
- X VAX/VMS 5.2 C compiler release 3.0 has a slightly better implemented
- X %g format than release 2.4, but not much. Trailing decimal points are
- X now removed, but trailing zeros are still not removed from %g numbers
- X in exponential format.
- *-*-END-of-docs/gnuplot.doc-*-*
- exit
-
-
-