Functions

Arguments to math functions in gnuplot can be integer, real, or complex unless otherwise noted. Functions that accept or return angles (e.g. sin(x)) treat angle values as radians, but this may be changed to degrees using the command set angles.


\begin{longtable}{\vert ccl\vert} \hline
\multicolumn{3}{\vert c\vert}{Math libr...
...
& & Note: voigt$(x,y)$\ = $real($faddeeva$(x+iy))$\ \\
\hline \end{longtable}


\begin{longtable}{\vert ccl\vert} \hline
\multicolumn{3}{\vert c\vert}{Special f...
...x^\prime;\sigma) L(x-x^\prime;\gamma) dx^\prime }} $\ \\
\hline \end{longtable}

String functions
Function Arguments Returns
gprintf("format",x,...) any string result from applying gnuplot's format parser
sprintf("format",x,...) multiple string result from C-language sprintf
strlen("string") string number of characters in string
strstrt("string","key") strings int index of first character of substring "key"
substr("string",beg,end) multiple string "string"[beg:end]
strftime("timeformat",t) any string result from applying gnuplot's time parser
strptime("timeformat",s) string seconds since year 1970 as given in string s
system("command") string string containing output stream of shell command
trim(" string ") string string without leading or trailing whitespace
word("string",n) string, int returns the nth word in "string"
words("string") string returns the number of words in "string"

other gnuplot functions
Function Arguments Returns
column(x) int or string column $x$ during datafile manipulation.
columnhead(x) int string containing first entry of column $x$ in datafile.
exists("X") string returns 1 if a variable named X is defined, 0 otherwise.
hsv2rgb(h,s,v) h,s,v $\in$ [0:1] 24bit RGB color value.
palette(z) double RGB palette color mapped to z.
stringcolumn(x) int or string content of column $x$ as a string.
timecolumn(N,"timeformat") int, string time data from column $N$ during data input.
tm_hour(x) int the hour
tm_mday(x) int the day of the month
tm_min(x) int the minute
tm_mon(x) int the month
tm_sec(x) int the second
tm_wday(x) int the day of the week
tm_yday(x) int the day of the year
tm_year(x) int the year
time(x) any the current system time
valid(x) int test validity of $\mbox{column}(x)$ during datafile manip.
value("name") string returns the value of the named variable.
voxel(x,y,z) real value of the active grid voxel containing point (x,y,z)


Subsections