Download gnuplot documentation

Transcript
22
gnuplot 4.4
13
EXPRESSIONS
The integer expression "1/0" may be used to generate an "undefined" flag, which causes a point to ignored; the
ternary operator gives an example. Or you can use the pre-defined variable NaN to achieve the same result.
The real and imaginary parts of complex expressions are always real, whatever the form in which they are
entered: in {3,2} the "3" and "2" are reals, not integers.
Gnuplot can also perform simple operations on strings and string variables. For example, the expression ("A" .
"B" eq "AB") evaluates as true, illustrating the string concatenation operator and the string equality operator.
A string which contains a numerical value is promoted to the corresponding integer or real value if used in a
numerical expression. Thus ("3" + "4" == 7) and (6.78 == "6.78") both evaluate to true. An integer, but
not a real or complex value, is promoted to a string if used in string concatenation. A typical case is the use of
integers to construct file names or other strings; e.g. ("file" . 4 eq "file4") is true.
Substrings can be specified using a postfixed range descriptor [beg:end]. For example, "ABCDEF"[3:4] ==
"CD" and "ABCDEF"[4:*] == "DEF" The syntax "string"[beg:end] is exactly equivalent to calling the builtin string-valued function substr("string",beg,end), except that you cannot omit either beg or end from the
function call.
13.1
Functions
The functions in gnuplot are the same as the corresponding functions in the Unix math library, except that
all functions accept integer, real, and complex arguments, unless otherwise noted.
For those functions that accept or return angles that may be given in either degrees or radians (sin(x), cos(x),
tan(x), asin(x), acos(x), atan(x), atan2(x) and arg(z)), the unit may be selected by set angles, which defaults
to radians.