FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GitHub Viewer

C Copyright (C) 1986 - 1993, 1998, 1999, 2000, 2001, 2004 Thomas Williams, Colin Kelley et al. C 1 Gnuplot ?gnuplot ^

An Interactive Plotting Program

^

Thomas Williams & Colin Kelley

^

Version 6 organized by Ethan A Merritt

^

Major contributors (alphabetic order):
^
^ Hans-Bernhard Broeker, John Campbell,
^ Robert Cunningham, David Denholm,
^ Gershon Elber, Roger Fearick,
^ Carsten Grammes, Lucas Hart, Lars Hecking,
^ Péter Juhász, Thomas Koenig, David Kotz,
^ Ed Kubaitis, Russell Lang, Timothée Lecomte,
^ Alexander Lehmann, Alexander Mai, Bastian Märkisch,
^ Tatsuro Matsuoka, Ethan A Merritt, Petr Mikulík,
^ Hiroki Motoyoshi, Carsten Steger, Shigeharu Takeno,
^ Tom Tkacik, Jos Van der Woude,
^ James R. Van Zandt, Alex Woo, Johannes Zellner
^

^

Copyright (C) 1986 - 1993, 1998 - 2004 Thomas Williams, Colin Kelley
^ Copyright (C) 2004 - 2023 various authors

^

Mailing list for comments: gnuplot-info@lists.sourceforge.net
^ Gnuplot home page
^ Issue trackers:   ^ bugs    ^ feature requests ^

This manual was originally prepared by Dick Crawford

^ 2 Copyright ?copyright ?license Copyright (C) 1986 - 1993, 1998, 2004, 2007 Thomas Williams, Colin Kelley Copyright (C) 2004-2023 various authors Permission to use, copy, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Permission to modify the software is granted, but not the right to distribute the complete modified source code. Modifications are to be distributed as patches to the released version. Permission to distribute binaries produced by compiling modified sources is granted, provided you 1. distribute the corresponding source modifications from the released version in the form of a patch file along with the binaries, 2. add special version identification to distinguish your version in addition to the base release version number, 3. provide your name and address as the primary contact for the support of your modified version, and 4. retain our contact information in regard to use of the base software. Permission to distribute the released version of the source code along with corresponding source modifications in the form of a patch file is granted with same provisions 2 through 4 for binary distributions. This software is provided "as is" without express or implied warranty to the extent permitted by applicable law. AUTHORS Original Software: Thomas Williams, Colin Kelley. Gnuplot 2.0 additions: Russell Lang, Dave Kotz, John Campbell. Gnuplot 3.0 additions: Gershon Elber and many others. Gnuplot 4.0 and subsequent releases: See list of contributors at head of this document. 2 Introduction ?introduction ? `Gnuplot` is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, macOS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986. Gnuplot can generate many types of plot in 2D and 3D. It can draw using lines, points, boxes, contours, vector fields, images, surfaces, and associated text. It also supports specialized graphs such as heat maps, spider plots, polar projection, histograms, boxplots, bee swarm plots, and nonlinear coordinates. Gnuplot supports many different types of output: interactive screen terminals (with mouse and hotkey input), direct output to pen plotters or modern printers, and output to many file formats (eps, emf, fig, jpeg, LaTeX, pdf, png, postscript, ...). Gnuplot is easily extensible to include new output modes. A recent example is support for webp animation. Mouseable plots embedded in web pages can be generated using the svg or HTML5 canvas terminal drivers. The command language of `gnuplot` is case sensitive, i.e. commands and function names written in lowercase are not the same as those written in capitals. All command names may be abbreviated as long as the abbreviation is not ambiguous. Any number of commands may appear on a line, separated by semicolons (;). Strings may be set off by either single or double quotes, although there are some subtle differences. See `syntax` and `quotes` for more details. Example: set title "My First Plot"; plot 'data'; print "all done!" Commands may extend over several input lines by ending each line but the last with a backslash (\). The backslash must be the _last_ character on each line. The effect is as if the backslash and newline were not there. That is, no white space is implied, nor is a comment terminated. Therefore, commenting out a continued line comments out the entire command (see `comments`). But note that if an error occurs somewhere on a multi-line command, the parser may not be able to locate precisely where the error is and in that case will not necessarily point to the correct line. In this document, curly braces ({}) denote optional arguments and a vertical bar (|) separates mutually exclusive choices. `Gnuplot` keywords or `help` topics are indicated by backquotes or `boldface` (where available). Angle brackets () are used to mark replaceable tokens. In many cases, a default value of the token will be taken for optional arguments if the token is omitted, but these cases are not always denoted with braces around the angle brackets. For built-in help on any topic, type `help` followed by the name of the topic or `help ?` to get a menu of available topics. A large set of demo plots is available on the web page ^ http://www.gnuplot.info/demo/ ^ When run from command line, gnuplot is invoked using the syntax gnuplot {OPTIONS} file1 file2 ... where file1, file2, etc. are input files as in the `load` command. Options interpreted by gnuplot may come anywhere on the line. Files are executed in the order specified, as are commands supplied by the -e option, for example gnuplot file1.in -e "reset" file2.in The special filename "-" is used to force reading from stdin. `Gnuplot` exits after the last file is processed. If no load files are named, `Gnuplot` takes interactive input from stdin. See help `batch/interactive` for more details. See `command-line-options` for more details, or type gnuplot --help In sessions with an interactive plot window you can hit 'h' anywhere on the plot for help about `hotkeys` and `mousing` features. 2 Seeking-assistance / Bugs ?help-desk ?faq ?FAQ ?bugs ?seeking-assistance The canonical gnuplot home page can be found at ^ http://www.gnuplot.info ^ Before seeking help, please check file FAQ.pdf or the above website for a ^ FAQ (Frequently Asked Questions) list. ^ Another resource for help with specific plotting problems (not bugs) is https://stackoverflow.com/questions/tagged/gnuplot Bug reports and feature requests should be uploaded to the trackers at https://sourceforge.net/p/gnuplot/_list/tickets Please check previous reports to see if the bug you want to report has already been fixed in a newer version. When reporting a bug or posting a question, please include full details of the gnuplot version, the terminal type, and the operating system. A short self-contained script demonstrating the problem is very helpful. Instructions for subscribing to gnuplot mailing lists may be found via the gnuplot development website ^ http://sourceforge.net/projects/gnuplot ^ Please note that before you write to any of the gnuplot mailing lists you must first subscribe to the list. This helps reduce the amount of spam. The address for mailing to list members is: gnuplot-info@lists.sourceforge.net A mailing list for those interested in the development version of gnuplot is: gnuplot-beta@lists.sourceforge.net 2 New features in version 6 ?new version_6 ?new ?version Version 6 is the latest major release in a history of gnuplot development dating back to 1986. It follows major version 5 (2015) and subsequent minor version releases 5.2 (2017) and 5.4 (2020). Development continues in a separate unreleased branch in the project git repository on SourceForge. Some features described in this document are present only if chosen and configured at the time gnuplot is compiled from source. To determine what configuration options were used to build the particular copy of gnuplot you are running, type `show version long`. 3 Function blocks and scoped variables ?new function blocks This version of gnuplot introduces a mechanism for invoking a block of standard gnuplot commands as a callable function. A function block can accept from 0 to 9 parameters and returns a value. Function blocks can be used to calculate and assign a new value to a variable, to combine with other functions and operators, or to perform a repetitive task preparing data. There are three components to this mechanism. See `local`, `scope`, `function blocks`, `return`. #start #b The `local` qualifier allows optional declaration of a variable or array ## whose scope is limited to the duration of execution of the program unit in ## which it is found. These units currently include execution of a ## `load` or `call` statement, function block evaluation, and the code block ## in curly brackets following an `if`, `else`, `do for`, or `while` statement. ## If the name of a local variable duplicates the name of a global variable, ## the global variable is shadowed until exit from the local scope. #b The `function` command declares a named function block (effectively an ## array of strings) containing gnuplot commands. When the function block ## is invoked, commands are executed successively until the end of the block ## or until a `return` command is encountered. #b The `return ` command terminates execution of a function block. ## The result of evaluating is returned as the value of the ## function. Anywhere outside a function block `return` acts like `exit`. #end Please see `function_block.dem` for an example of using this mechanism to define and plot a non-trivial function that is too complicated for a simple one-line definition `f(x) = ...`. 3 Special and complex-valued functions ?new math Gnuplot 6 provides an expanded set of complex-valued functions and updated versions of some functions that were present in earlier versions. #start #b New: Riemann zeta function with complex domain and range. See `zeta`. #b Updated lower incomplete gamma function with improved domain and precision. ## Complex arguments accepted. ## See `igamma`. #b New upper incomplete gamma function (real arguments only). ## See `uigamma`. #b Updated incomplete beta function with improved domain and precision. ## See `ibeta`. #b New function for the inverse incomplete gamma function. ## See `invigamma`. #b New function for the inverse incomplete beta function. ## See `invibeta`. #b New complex function LambertW(z,k) returns the kth branch of multivalued ## function W_k(z). ^
## Note that the older function lambertw(x) = real(LambertW( real(z), 0 )). ## See `LambertW`. #b New complex function lnGamma(z). ## Note that existing function lgamma(x) = real(lnGamma(real(z)). ## See `lnGamma`. #b Complex function conj(z) returns the complex conjugate of z. #b Synchrotron function F(x), see `SynchrotronF`. #b acosh(z) domain extended to cover negative real axis. #b asin(z) asinh(z) improved precision for complex arguments. #b Predefined variable I = sqrt(-1) = {0,1} for convenience. ^
## This is useful because gnuplot does not accept {a,b} as a valid complex ## constant but does accept (a + b*I) as a valid complex expression. #end Additional special functions are supported if a suitable external library is found at build time. See `special_functions`. #start #b Complex Bessel functions Iν(z), Jν(z), Kν(z), Yν(z) of order ν (real) ## with complex argument z. See `BesselK`. #b Complex Hankel functions H1ν(z), H2ν(z) of order ν with complex z. ## See `BesselH1`. #b Complex Airy functions Ai(z), Bi(z). #b Complex exponential integral of order n. See `expint`. #b Fresnel integrals C(x) and S(x). See `FresnelC`. #b Function `VP_fwhm(sigma,gamma)` returns the full width at half maximum ## of the Voigt profile. See `VP`, `VP_fwhm`. #end 3 New plot styles ?new styles #start #b The plot style `with surface` works in 2D polar coordinates to produce ## a solid-fill gridded representation of the plane, colored by weighted ## contributions from an arbitrary set of input points. This is analogous to ## the use of `dgrid3d` and style `with pm3d` to produce a 3D gridded surface. ## See `set polar grid` and `polar heatmap`. #b New 2D plot style `with sectors` is an alternative to generating a full ## polar gridded surface. For each input data point it generates a single ## annular wedge in a conceptual polar grid. Unlike polar mode `with surface` ## it can be used in either a polar or cartesian coordinate graph. #b New 2D plot style `with hsteps` allows construction of step-like plots with ## a variety of representations in addition to those offered by existing styles ## `steps`, `histeps`, `fsteps`, and `fillsteps`. See `hsteps`. #b Plot style `with lines` now has a filter option `sharpen`. This filter ## detects spikes in a function plot that appear truncated in the output ## because the peak lies between two x-coordinates at which the function has ## been sampled. It adds a new sample point at the location of each such peak. ## See `filters`. #b Although it is not strictly speaking a new plot style, the combination ## of the concave hull filter with along-path smoothing of filled areas ## allows creation of 'blobby region' plots showing, for example, ## the extents of overlapping data clusters. See `concavehull`. #b 3D plot style `with pm3d` accepts an optional modifier `zclip [zmin:zmax]` ## that selects only a slice of the full surface. Successive plots with ## incremental changes to the clipping limits can be used to animate a ## cross-sectional cutaway view in 3D or to create a filled area contour map. ## This is automated by a new plot style `with contourfill`, that is ## particularly useful in 2D projection. See `set contourfill`. #end D polargrid 4 DB D windrose 1 D sectors 4 DB D sharpen 1 D iris 2 DB D contourfill 4 DB D logic_timing 1 D rank_sequence 1 3 Hulls, masks, and smoothing ?new hulls #start #b A cluster of 2D points can be replaced by its bounding polygon using the ## new filter `convexhull`. A path-smoothed bounding curve can be plotted ## as a filled area using "convexhull smooth path with filledcurves". ## See `convexhull`. #b An alternative experimental filter `concavehull` generates a bounding ## polygon that is not necessarily convex; instead it forms a χ-shape ## determined by a characteristic length parameter that controls the degree ## of concavity. This essentially draws a blob around the data points. ## See `concavehull`. #b A convex hull or other polygon can be used as a mask to display only ## selected portions of a pm3d surface or an image plot. ## See new plot style `with mask` (defines a mask) and keyword `mask` ## (applies the mask to a subsequent plot component). #b curve smoothing using along-path cubic splines suitable for closed curves ## or for 2D curves that are not monotonic on x. See `smooth path`. ## This allows smoothing of hulls and masks. #b cubic spline smoothing of 3D lines. See `splot smooth csplines` #b Smoothing options apply to plotting `with filledcurves` {above|below|between}. #b New keyword `period` for smoothing periodic data. See `smooth kdensity`. #end D convex_hull 2 D mask_pm3d 3 D smooth_path 2 3 Named palettes ?new colormaps #start #b The current palette can be saved to a named colormap for future use. ## See `set colormap`. #b pm3d and image plots can specify a previously saved palette by name. ## This permits the use of multiple palettes in a single plot command. ## See `colorspec palette`. #b Named palette colormaps can be manipulated as arrays of 32-bit ARGB ## color values. This permits addition of alpha-channel values or other ## modifications not easily specified in a `set palette` command. #b There is a new predefined color scheme `set palette viridis`. #b Palettes read from a file or datablock (`set palette file`) may be specified ## either using fractional color components or 24-bit packed RGB values. #end D named_palettes 4 D viridis 1 3 New data formats ?new data_formats #start #b The `sparse matrix=(cols,rows)` option to `plot` and `splot` generates ## a uniform pixel grid into which individual pixel values may be loaded in ## any order. This is useful for plotting heat maps from incomplete data. ## See `sparse`. #b During input of non-uniform matrix data, column(0) now returns the linear ## ordering of matrix elements. I.e. for element A[i,j] in an MxN matrix A, ## column(0)/M gives the row index i, and column(0)%M gives the column index j. #end 3 New built-in functions and array operations ?new built-in functions #start #b `palette(z)` returns the current RGB palette color mapping z into cbrange. #b `rgbcolor("name")` returns the 32bit ARGB value for a named color. #b `index( Array, element )` returns the first index `i` for which ## Array[i] is equal to element. See `arrays`. #b User-defined functions allow an array as a parameter. ^
## Example: dot(A,B) = sum [i=1:|A|] A[i]*B[i] #b Array slices are generated by appending a range to the array name. ## Array[n] is single element. Array[n:n+5] is a six element slice of ## the original array. See `arrays`, `slice`. #b `split("string", "separator")` unpacks the fields in a string into ## an array of strings. See `split`. #b `join(array, "separator")` is the complement to `split`. It concatenates ## the elements of a string array into a single string with field separators. ## See `join`. #b `stats ` yields a testable value. See `stats test`. #b `stats $vgrid` finds min/max/mean/stddev of voxels in grid #end 3 Program control flow ?control flow #start #b New syntax `if ... else if ... else ...` #b XDG base directory conventions for configuration preferences are supported. ## The program reads initial commands from $XDG_CONFIG_HOME/gnuplot/gnuplotrc. ## Session command history is saved to $XDG_STATE_HOME/gnuplot_history. ## If these files are not found, $HOME/.gnuplot and $HOME/.gnuplot_history ## are used as in previous gnuplot versions. #b `unset warnings` suppresses output of warning messages to the console. #b Exception handling for the "fit" command. Control always returns to the ## next line of input, even in the case of fit errors. On return, FIT_ERROR is ## non-zero if an error occurred. This allows scripted recovery from a bad fit. ## See `fit error_recovery`. #end 3 New terminals and terminal options ?new terminals #start #b New terminals `kittygd` and `kittycairo` provide in-window graphics for ## terminal emulators that support the kitty protocol. Kitty is an alternative ## to sixel graphics that offers full 24-bit RGB color. See `kittycairo`. #b New terminal `block` for text-mode pseudo-graphics uses Unicode ## block or Braille characters to offer improved resolution compared ## to the `dumb` or `caca` terminals. #b New terminal `webp` generates a single frame or an animation sequence ## using webp encoding. Frames are generated using pngcairo, then ## encoded through the WebPAnimEncoder API exported by libwebp and libwebpmux. #b Terminals that use the same window for text entry and graphical display, ## including `dumb`, `sixel`, `kitty`, and `block`, now respond to keyboard ## input during a `pause mouse` command. While paused, they interpret keystrokes ## in the same way that a mousing terminal would. See `pseudo-mousing`. ## For example the left/right/up/down arrow keys change the view angle of 3D ## plots and perform incremental pan/zoom steps for 2D plots. #end 3 Watchpoints ?new watchpoints Watchpoints are target values associated with individual plots in a graph. As that plot is drawn, each component line segment is monitored to see if its endpoints bracket the target value of a watchpoint coordinate (x, y, or z) or function f(x,y). If a match is found, the [x,y] coordinates of the match point are saved for later use. See `watchpoints`. Possible uses include #start #b Find the intersection points of two curves #b Find zeros of a function #b Find and notate where a dependent variable (y or z) or function f(x,y) ## crosses a threshold value #b Use the mouse to track values along multiple plots simultaneously #end 3 Week-date time support ?new week-date time The Covid-19 pandemic of 2020/2021 generated increased interest in plotting epidemiological data, which is often tabulated using a "week date" reporting convention. Deficiencies with gnuplot support for this convention were remedied and the support for week-date time was extended. #start #b Time specifier format %W has been brought into accord with the ## ISO 8601 week date standard. #b Time specifier format %U has been brought into accord with the ## CDC/MMWR week date standard. #b New function `tm_week(time, std)` returns ISO or CDC standard week of year. #b New function `weekdate_iso(year, week, day)` converts ISO standard week date ## to calendar time. #b New function `weekdate_cdc(year, week, day)` converts CDC standard week date ## to calendar time. #end D epi_data 1 3 Other new features ?new features #start #b `Time units for setting major and minor tics.` ## Both major and minor tics along a time axis now accept tic intervals given ## in units of minutes/hours/days/weeks/months/years. ## See `set xtics`, `set mxtics time`. #b The character sequence $# in a `using` specifier evaluates to the total ## number of columns available in the current line of data. For example ## "plot FOO using 0:(column($# - 1))" plots the last-but-one field of each row. #b keyword `binvalue=avg` plots the average, rather than the sum, of binned data. #b `set colorbox bottom` places a horizontal color box underneath the plot ## rather than a vertical box on the right. #b Improved rendering of intersecting pm3d surfaces - overlapping surface tiles ## are split into two pieces along the line of intersection so that tiles ## from one surface do not incorrectly protrude though the other surface. #b User-controlled spotlight added to the pm3d lighting model. ## See `set pm3d spotlight`. #b New options to force total key width and number of columns. See `key layout`. #b `set pm3d border retrace` draws a border around each pm3d quadrangle in the ## same color as the filled area. In principle this should have no visible ## effect, but it prevents some display modes like glitchy pdf or postscript ## viewers from introducing aliasing artifacts. #b `set isotropic` adjusts the axis scaling in both 2D and 3D plots such that ## the x, y, and z axes all have the same scale. #b Change: Text rotation angle is not limited to integral degrees. #b Special (non-numerical) linetypes `lt nodraw`, `lt black`, `lt bgnd` ## See `special_linetypes`. #b Data-driven color assignments in histogram plots. See `histograms colors`. #b The position of the key box can be manually tweaked by specifying an ## offset to be added to whatever position the program would otherwise use. ## See `set key offset`. #end 3 Brief summary of features introduced in version 5 ?new version_5 ?version_5 4 Features introduced in 5.4 ?new version_5 version_5.4 ?version_5 version_5.4 #start #b Expressions and functions use 64-bit integer arithmetic. See `integer` #b 2D plot styles `polygons`, `spiderplot`, `arrows` #b 3D plot styles `boxes`, `circles`, `polygons`, `isosurface` and ## other representations of gridded voxel data #b Data preprocessing filter `zsort` #b Construction of customized keys using `keyentry` #b New LaTeX terminal pict2e supersedes older terminals `latex`, `emtex`, `eepic`, ## and `tpic`. The older terminals are no longer built by default #b `set pixmap` imports a png/jpeg/gif image as a pixmap that can be scaled and ## positioned anywhere in a plot or on the page #b Enhanced text mode accepts \U+xxxx (xxxx is a 4 or 5 character hexadecimal) ## as representing a Unicode code point that is converted to the corresponding ## UTF-8 byte sequence on output #b Revised syntax for `with parallelaxes` allows convenient iteration inside the ## plot command, similar to plot styles `histogram` and `spiderplot` #end 4 Features introduced in 5.2 ?new version_5 version_5.2 ?version_5 version_5.2 #start #b Nonlinear coordinate systems (see `set nonlinear`) #b Automated binning of data (see `bins`) #b 2D beeswarm plots. See `set jitter` #b 3D plot style `zerrorfill` #b 3D lighting model provides shading and specular highlighted (see `lighting`). #b Array data type, associated commands and operators. See `arrays`. #b New terminals `sixelgd`, `domterm` #b New format descriptors tH tM tS handle relative times (interval lengths). ## See `time_specifiers`. #end 4 Features introduced in 5.0 ?new version_5 version_5.0 ?version_5 version_5.0 #start #b Terminal independent dash types. #b The default sequence of colors used for successive elements in a plot is ## more easily distinguished by users with color-vision defects. #b New plot types `with parallelaxes`, `with table`. #b Hypertext labels activated by a mouse-over event. #b Explicit sampling ranges in 2D and 3D function plots and pseudofiles ## '+' and '++'. #b Plugin support through new command `import` that attaches a user-defined ## function name to a function provided by an external shared object. #end 2 Differences between versions 5 and 6 Some changes introduced in version 5 could cause certain scripts written for earlier versions of gnuplot to fail or to behave differently. There are very few such changes in version 6. 3 Deprecated syntax ?deprecated syntax Deprecated in version 5.4, removed in 6.0 # use of a file containing `reread` to perform iteration N = 0; load "file-containing-reread"; file content: N = N+1 plot func(N,x) pause -1 if (N0,z ^ imag(x) complex Im(x), imaginary part of x as a real number ^ int(x) real integer part of x, truncated toward zero ^ invibeta(a,b,p) 0<p<1 inverse incomplete beta function ^ invigamma(a,p) 0<p<1 inverse incomplete gamma function ^ invnorm(x) any inverse normal distribution function real(x) ^ LambertW(z,k) complex, int kth branch of complex Lambert W function ^ lambertw(x) real principal branch (k=0) of Lambert W function ^ lgamma(x) real lgamma(Re(x)), lgamma function of real(x) ^ lnGamma(x) complex lnGamma(x) valid over entire complex plane ^ log(x) any ln x, natural logarithm (base e) of x ^ log10(x) any log10 x, logarithm (base 10) of x ^ norm(x) any norm(x), normal distribution function of real(x) ^ rand(x) int pseudo random number in the interval (0:1) ^ real(x) any Re(x), real part of x ^ sgn(x) any 1 if x > 0, -1 if x < 0, 0 if x = 0. ℑ(x) ignored ^ Sign(x) complex 0 if x = 0, otherwise x/|x| ^ sin(x) any sin x, sine of x ^ sinh(x) any sinh x, hyperbolic sine of x in radians ^ sqrt(x) any √x, square root of x ^ SynchrotronF(x) real Synchtrotron function F ^ tan(x) any tan x, tangent of x ^ tanh(x) any tanh x, hyperbolic tangent of x in radians ^ uigamma(a,x) real uigamma(a,x), upper incomplete gamma function a>0,x ^ voigt(x,y) real convolution of Gaussian and Lorentzian ^ zeta(s) any Riemann zeta function ^ ^ ^

 

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
Special functions from libcerf (only if available)
Function Arguments Returns
cerf(z) complex complex error function
cdawson(z) complex complex Dawson's integral
faddeeva(z) complex rescaled complex error function w(z) = exp(-z²) × erfc(-iz)
erfi(x) real imaginary error function erfi(x) = -i × erf(ix)
FresnelC(x) real cosine (real) component of Fresnel integral
FresnelS(x) real sine (imaginary) component of Fresnel integral
VP(x,sigma,gamma) real Voigt profile
VP_fwhm(sigma,gamma) real Voigt profile full width at half max
^

 

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
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]
split("string","separator") string array containing individual fields of original string
join(array,"separator") array,string concatenates array elements into a string
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"
^

 

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
time functions
Function Arguments Returns
time(x) any the current system time
timecolumn(N,format) int, string formatted time data from column N of input data
tm_hour(t) time in sec the hour
tm_mday(t) time in sec the day of the month
tm_min(t) time in sec the minute
tm_mon(t) time in sec the month
tm_sec(t) time in sec the second
tm_wday(t) time in sec the day of the week
tm_week(t) time in sec ISO 8601 week of year
tm_yday(t) time in sec the day of the year
tm_year(t) time in sec the year
weekdate_iso(year,week,day) int time eqv to ISO 8601 standard week date
weekdate_cdc(year,week,day) int time eqv to CDC epidemiological week date
^

 

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
other gnuplot functions
Function Arguments Returns
column(x) int or string contents of column x during data input.
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] converts HSV color to 24bit RGB color.
index(A,x) array, any returns i such that A[i] equals x
palette(z) real 24bit RGB palette color mapped to z
rgbcolor("name") string 32bit ARGB color from name
stringcolumn(x) int content column x as a string.
valid(x) int test validity of column x during datafile input
value("name") string returns the current value of the named variable.
C For TeX and troff output a table replaces the help sections below. C For the HTML help we want both, table and sections, so the magic C marker below is used to signal this to doc2html: ^ @start table #\begin{longtable}{@{\extracolsep{\fill}}|lcrl|@{}} \hline #\multicolumn{4}{|c|}{Math library and built-in functions} \\ \hline \hline #Function & Arguments & ~ & Returns ({\gpCX } indicates complex result) \\ \hline #\endhead \hline \endfoot %c c l . %Function@Arguments@Returns %_ 4 abs ?expressions functions abs ?abs #abs(x) & int or real & ~ & absolute value of $x$, $|x|$ \\ #abs(x) & complex & ~ & length of $x$, $\sqrt{{\mbox{real}(x)^{2} + #\mbox{imag}(x)^{2}}}$ \\ %abs(x)@int or real@absolute value of $x$, $|x|$ %abs(x)@complex@length of $x$, $sqrt{roman real (x) sup 2 + roman imag (x) sup 2}$ The `abs(x)` function returns the absolute value of its argument. The returned value is of the same type as the argument. =norm =modulus For complex arguments, abs(x) is defined as the length of x in the complex plane [i.e., sqrt(real(x)**2 + imag(x)**2) ]. This is also known as the norm or complex modulus of x. 4 acos ?expressions functions acos ?acos #acos(x) & ~~ & \gpCX & $\cos^{-1} x$ (inverse cosine) \\ %acos(x)@ ~~ @$cos sup -1 x$ (inverse cosine) The `acos(x)` function returns the arc cosine (inverse cosine) of its argument. `acos` returns its argument in radians or degrees, as selected by `set angles`. 4 acosh ?expressions functions acosh ?acosh #acosh(x) & ~~ & \gpCX & $\cosh^{-1} x$ (inverse hyperbolic cosine) \\ %acosh(x)@ ~~ @$cosh sup -1 x$ (inverse hyperbolic cosine) The `acosh(x)` function returns the inverse hyperbolic cosine of its argument in radians or degrees, as selected by `set angles`. 4 airy ?expressions functions airy ?airy #airy(x) & real & ~ & Airy function Ai(x) for real x\\ %airy(x)@ real @Airy function Ai(x) for real x The `airy(x)` function returns the value of the Airy function Ai(x) of its argument. The function Ai(x) is that solution of the equation y'' - x y = 0 which is everywhere finite. If the argument is complex, its imaginary part is ignored. 4 arg ?expressions functions arg ?arg #arg(x) & complex & ~ & the phase of $x$, $-\pi\leq$arg($x$)$\leq\pi$ \\ %arg(x)@complex@the phase of $x$ The `arg(x)` function returns the phase of a complex number in radians or degrees, as selected by `set angles`. 4 asin ?expressions functions asin ?asin #asin(x) & ~~ & \gpCX & $\sin^{-1} x$ (inverse sin) \\ %asin(x)@ ~~ @$sin sup -1 x$ (inverse sin) The `asin(x)` function returns the arc sin (inverse sin) of its argument. `asin` returns its argument in radians or degrees, as selected by `set angles`. 4 asinh ?expressions functions asinh ?asinh #asinh(x) & ~~ & \gpCX & $\sinh^{-1} x$ (inverse hyperbolic sin) \\ %asinh(x)@ ~~ @$sinh sup -1 x$ (inverse hyperbolic sin) The `asinh(x)` function returns the inverse hyperbolic sin of its argument in radians or degrees, as selected by `set angles`. 4 atan ?expressions functions atan ?atan #atan(x) & ~~ & \gpCX & $\tan^{-1} x$ (inverse tangent) \\ %atan(x)@ ~~ @$tan sup -1 x$ (inverse tangent) The `atan(x)` function returns the arc tangent (inverse tangent) of its argument. `atan` returns its argument in radians or degrees, as selected by `set angles`. 4 atan2 ?expressions functions atan2 ?atan2 #atan2(y,x) & int or real & ~ & $\tan^{-1} (y/x)$ (inverse tangent) \\ %atan2(y,x)@int or real@$tan sup -1 (y/x)$ (inverse tangent) The `atan2(y,x)` function returns the arc tangent (inverse tangent) of the ratio of the real parts of its arguments. `atan2` returns its argument in radians or degrees, as selected by `set angles`, in the correct quadrant. 4 atanh ?expressions functions atanh ?atanh #atanh(x) & ~~ & \gpCX & $\tanh^{-1} x$ (inverse hyperbolic tangent) \\ %atanh(x)@ ~~ @$tanh sup -1 x$ (inverse hyperbolic tangent) The `atanh(x)` function returns the inverse hyperbolic tangent of its argument in radians or degrees, as selected by `set angles`. 4 besj0 ?expressions functions besj0 ?besj0 # besj0(x) & real & ~ & $J_{0}$ Bessel function of $x$ in radians \\ %besj0(x)@real@$J sub 0$ Bessel function of $x$ in radians The `besj0(x)` function returns the J0th Bessel function of its argument. `besj0` expects its argument to be in radians. 4 besj1 ?expressions functions besj1 ?besj1 # besj1(x) & real & ~ & $J_{1}$ Bessel function of $x$ in radians \\ %besj1(x)@real@$J sub 1$ Bessel function of $x$ in radians The `besj1(x)` function returns the J1st Bessel function of its argument. `besj1` expects its argument to be in radians. 4 besjn ?expressions functions besjn ?besjn # besjn(n,x) & int, real & ~ & $J_{n}$ Bessel function of $x$ in radians \\ %besjn(n,x)@int,real@$J sub n$ Bessel function of $x$ in radians The `besjn(n,x)` functions returns the Jn Bessel function of x in radians. 4 besy0 ?expressions functions besy0 ?besy0 # besy0(x) & real & ~ & $Y_{0}$ Bessel function of $x$ in radians \\ %besy0(x)@real@$Y sub 0$ Bessel function of $x$ in radians The `besy0(x)` function returns the Y0th Bessel function of its argument. `besy0` expects its argument to be in radians. 4 besy1 ?expressions functions besy1 ?besy1 # besy1(x) & real & ~ & $Y_{1}$ Bessel function of $x$ in radians \\ %besy1(x)@real@$Y sub 1$ Bessel function of $x$ in radians The `besy1(x)` function returns the Y1st Bessel function of its argument. `besy1` expects its argument to be in radians. 4 besyn ?expressions functions besyn ?besyn # besyn(n,x) & int, real & ~ & $Y_{n}$ Bessel function of $x$ in radians \\ %besyn(n,x)@int,real@$Y sub n$ Bessel function of $x$ in radians The `besyn(n,x)` functions returns the Yn Bessel function of x in radians. 4 besi0 ?expressions functions besi0 ?besi0 # besi0(x) &real & ~ & Modified Bessel function of order 0, $x$ in radians \\ %besi0(x)@real@ Modified Bessel function of order 0, $x$ in radians The `besi0(x)` function is the modified Bessel function or order 0. `besi0` expects its argument to be in radians. 4 besi1 ?expressions functions besi1 ?besi1 # besi1(x) &real & ~ & Modified Bessel function of order 1, $x$ in radians \\ %besi1(x)@real@ Modified Bessel function of order 1, $x$ in radians The `besi1(x)` function is the modified Bessel function or order 1. `besi1` expects its argument to be in radians. 4 besin ?expressions functions besin ?besin # besin(n,x) &int, real & ~ & Modified Bessel function of order n, $x$ in radians \\ %besin(x)@int,real@ Modified Bessel function of order n, $x$ in radians `besin(n,x)` is the modified Bessel function or order n for integer n and x in radians. 4 cbrt ?expressions functions cbrt ?cbrt #cbrt(x) & real & ~ & cube root of $x$ (domain and range both limited to real) \\ %cbrt(x)@ real @ cube root of x (domain and range both limited to real) `cbrt(x)` returns the cube root of x. If x is not real, returns NaN. ?? C 4 ceil C ?expressions functions ceil #ceil(x) & ~~ & ~ & $\lceil x \rceil$, smallest integer not less than the real part of $x$ \\ %ceil(x)@ ~~ @$left ceiling x right ceiling$, smallest integer not less than $x$ (real part) `ceil(x)` returns the smallest integer not less than the real part of x. Outside the domain |x|

Back | FazBrowse Home | New Git URL