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. The sgn function is also supported, as in BASIC.

Function Arguments Returns
abs(x) any absolute value of x, | x|; same type
abs(x) complex length of x, $\sqrt{{{\mbox{real}(x)^{2} +
\mbox{imag}(x)^{2}}}}$
acos(x) any cos-1x (inverse cosine) in radians
arg(x) complex the phase of x in radians
asin(x) any sin-1x (inverse sin) in radians
atan(x) any tan-1x (inverse tangent) in radians
besj0(x) radians j0 Bessel function of x
besj1(x) radians j1 Bessel function of x
besy0(x) radians y0 Bessel function of x
besy1(x) radians y1 Bessel function of x
ceil(x) any x⌉, smallest integer not less than x (real part)
cos(x) radians cos x, cosine of x
cosh(x) radians cosh x, hyperbolic cosine of x
erf(x) any Erf(real(x)), error function of real(x)
erfc(x) any Erfc(real(x)), 1.0 - error function of real(x)
exp(x) any ex, exponential function of x
floor(x) any x⌋, largest integer not greater than x (real part)
gamma(x) any Gamma(real(x)), gamma function of real(x)
ibeta(p,q,x) any Ibeta(real(p, q, x)), ibeta function of real(p,q,x)
inverf(x) any inverse error function of real(x)
igamma(a,x) any Igamma(real(a, x)), igamma function of real(a,x)
imag(x) complex imaginary part of x as a real number
invnorm(x) any inverse normal distribution function of real(x)
int(x) real integer part of x, truncated toward zero
lgamma(x) any Lgamma(real(x)), lgamma function of real(x)
log(x) any logex, natural logarithm (base e) of x
log10(x) any log10x, logarithm (base 10) of x
norm(x) any normal distribution (Gaussian) function of real(x)
rand(x) any Rand(real(x)), pseudo random number generator
real(x) any real part of x
sgn(x) any 1 if x > 0, -1 if x < 0, 0 if x = 0. imag(x) ignored
sin(x) radians sin x, sine of x
sinh(x) radians sinh x, hyperbolic sine x
sqrt(x) any $\sqrt{{x}}$, square root of x
tan(x) radians tan x, tangent of x
tanh(x) radians tanh x, hyperbolic tangent of x