?gnuplot ?copyright ?license Copyright (C) 1986 - 1993, 1998, 2004, 2007 Thomas Williams, Colin Kelley 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 5.0 additions: See list of contributors at head of this document. ?introduction ? `Gnuplot` is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, 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 supports many types of plots in either 2D and 3D. It can draw using lines, points, boxes, contours, vector fields, surfaces, and various associated text. It also supports various specialized plot types. 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. Recent additions include interactive terminals based on wxWidgets (usable on multiple platforms), and Qt. 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 file as in the `load` command. On X11-based systems, you can use gnuplot {X11OPTIONS} {OPTIONS} file1 file2 ... see your X11 documentation and `x11` in this document. 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. The options specific to gnuplot can be listed by typing gnuplot --help See `command-line-options` for more details. In sessions with an interactive plot window you can hit 'h' anywhere on the plot for help about `hotkeys` and `mousing` features. Section `seeking-assistance` will help you to find further information, help and FAQ. ?help-desk ?faq ?FAQ ?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 http://sourceforge.net/projects/gnuplot/support 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 on SourceForge 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 ?new These sections list new commands, plot styles, and other features introduced in version 5.4. ?new 64-bit_arithmetic * All evaluation of expressions and functions uses 64-integer arithmetic if supported by the platform. * Integer overflow is detected and handled according to user preference. See `overflow`. ?new voxels Gnuplot now supports operations based on 3D grids of voxel data. * `set vgrid $gridname size N` creates an NxNxN grid of voxels. * `set vxrange [vxmin:vxmax]` together with `set vyrange` and `set vzrange` define which region of space the grid occupies. This may or may not be identical to the xyz range of the plot. * `voxel(x,y,z)` can be used in expressions to read or write an individual voxel. * `vfill DATA_SOURCE using x:y:z:radius:()` acts analogously to a plot command except that instead of plotting it increments voxels near each point in the input data. * `vclear $gridname` resets an existing voxel grid to contain all zero values. * the current contents of one or more voxel grids can be referenced by `splot` commands to assign colors or other properties of plot elements by using the `voxel` function in using specifiers. See demo `voxel.dem`. * voxel grids can also be plotted by name in `splot` commands with plot styles `dots`, `points`, or `isosurface`. See demo `vplot.dem`. ?new plot_styles * 3D plot style `with polygons` reads polygon faces from a data file. This can be used to create a surface or to construct a solid object. See `with polygons`. * `splot $voxelgrid with {dots|points}` marks all voxels whose value is above a requested threshold level. * `splot $voxelgrid with isosurface` creates a tessellated 3D surface enclosing voxels above a requested threshold level. See `isosurface`. * Voxel grid values can be referenced in the `using` specifiers for 3D plots. * `set spiderplot` selects a new plotting mode allowing creation of spider plots (also known as radar charts). These are essentially parallel axis plots where the axes are arranged radially rather than vertically. See `spiderplot`, `set style spiderplot`, `set paxis`. * Plot style `with circles` can be used in 3D plots. * Plot style `with boxes` can be used in 3D plots. * 2D plot style `with arrows` is identical to `with vectors` except that each arrow is specified using x:y:length:angle rather than x:y:xdelta:ydelta * splot FOO with pm3d fillcolor * pm3d surfaces can have individual fillstyle and separate top/bottom fillcolor * pm3d option `noclipcb` causes quadrangles with palette color outside cbrange to be skipped rather than being drawn with color clipped to cbmin or cbmax. * Customized contour line types. See `set cntrparam`. ?new filters * `smooth zsort` sorts 2D points on values in a 3rd column. See `smooth zsort`. ?new commands * Voxel grid commands. See `set vgrid`, `set vxrange`, `vclear`, `vfill`, and `voxel`. * New options for showing the xy xz and yz planes in 3D plots. See `set walls`, `set grid vertical`. * `set table separator {tab|comma|"char"}` can be used to create csv files. See `plot with table`. * New options `set view projection {xy|xz|yz}` adjust view angles, axis tic and label placement to generate a 2D projection of a 3D splot. `set view projection xy` is equivalent to `set view map`. * `set rgbmax ` controls interpretation of input RGB values. * Array size can be implicit if an initializer is present, e.g. `Array A = [1,2,3]`. * Optional radial clipping of line segments in polar mode. See `set clip`. * Extra lines to customize the key can be added by substituting `keyentry` in place of a filename or function in `plot` and `splot` commands. This produces a line in the key without generating a corresponding plot. See `keyentry`. * User-specified translation of mouse coordinates (EXPERIMENTAL). See map_projection demo. * `set datafile columnheaders` causes first line of input to be read as strings rather than as data values. Equivalent to `set key autotitle columnheader` except that it does not affect generation of key entries. If this option is in effect the `stats` command will generate an array of strings containing the column headers found. * You can define multiple textbox styles. See `set style textbox`. ?new terminals * The `pcl5` terminal has been extended to support PCL5e/PCL5c printers and many modern gnuplot features. * The `pstricks` terminal has been extended to support many modern gnuplot features including RGB colors and transparency, filled polygons, and boxes. * New terminal `pict2e` to use the LaTeX2e pict2e environment. It directly supersedes older terminals `latex`, `emtex`, `eepic`, and `tpic`, which are no longer built by default. * The `texdraw` terminal has been extended to support text at arbitrary angles, variable line width, v5 dashed lines, and filled boxes and polygons. It can now be used with plain TeX, too. * The previously experimental Direct2D variant of the `windows` terminal replaces the GDI and GDI+ variants. It now supports printing using D2D and color fonts. * The `pm` OS/2 terminal has been modernized to support e.g. uft8, bold and italic text, and dashed lines. (Since 5.2.7). * The `dospc` and `svga` DOS terminals have been modernized and now support interactive keyboard and mouse (svga only) input. ?new pixmaps * `set pixmap` allows import of an image in standard format (png jpeg gif) as a pixmap that can be positioned anywhere in a plot or on the page. Unlike plotting `with image`, pixmap objects retain their original aspect ratio and size independent of axis scaling or rotation. See `pixmap`. ?new week-date_formats The Covid-19 pandemic of 2020/2021 generated increased interest in plotting epidemiological data, which is often tabulated using a "week date" reporting convention. This revealed deficiencies with gnuplot support for this convention, including errors in time formats %W and %U. These formats worked incorrectly prior to version 5.4.2. * Time specifier format %W has been brought into accord with the ISO 8601 week date standard. * Time specifier format %U has been brought into accord with the CDC/MMWR week date standard. * New function `tm_week(time, std)` returns ISO or CDC standard week of year. * New function `weekdate_iso(year, week, day)` converts ISO standard week date to calendar time. * New function `weekdate_cdc(year, week, day)` converts CDC standard week date to calendar time. ?new other * 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. * 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. * Time/date input recognizes format %p to handle am/pm field * plot titles are evaluated *after* plotting, rather than before. This allows the title to reference quantities calculated while plotting. * Built-in modified Bessel functions (besi0 besi1 besin) * Built-in order N Bessel functions of the 1st and 2nd kind (besjn besyn) ?new changes * `pm3d filled area quadrangles` are clipped smoothly to current zrange. This affects pm3d surfaces and also the faces of 3D boxes, polygons, etc. * Revised syntax for plot style 'with parallelaxes'. See `parallel`. The histogram, parallelaxis, and spiderplot styles now use similar syntax that can iterate over plot elements: `plot for [column=1:N] DATA using column` * Sampling generated by pseudofile '+' is affected by `set trange`. * Offsets from `set offsets` are applied only to autoscaled axes. The documentation has always said this, but it was not applied consistently. * Imaginary values returned by the using specifier of a 2D plot are treated as undefined values (NaN) rather than as real(value). This was always true for function plots and 3D data plots. E.g. the following two plots are equivalent. plot [-1:1] sqrt(x); plot [-1:1] '+' using 1:(sqrt($1) * The `set fontpath` command is deprecated. The search path for fonts to be embedded in output from the postscript terminal has been revised. * 3D plot style `with zerrorfill`. See `zerrorfill`, `fenceplots` and zerror demo. * Beeswarm plots. See `set jitter`, `beeswarm` and beeswarm plot demo * The symbol used for individual points in a plot can be controlled by data values (see `pointtype variable`) * Normalized frequency of occurrence in a data set (see `smooth fnormal`) * Automated binning of data (see `bins`) * Polar coordinates may be used in label, arrow, and object definitions * `set [m]ttics` places ticmarks and labels on the perimeter of a polar plot. See * `set rlabel` places a label above the r axis * Inverted `rrange` (i.e. set rrange [90:0]) allows use of celestial horizontal coordinates. See * `set border polar` draws a solid line around the perimeter of a polar plot * `set theta` controls the position of theta = 0 around the perimeter of a polar plot and the sense (clockwise or anti-clockwise) of increasing theta * Any plot axis can be assigned a pair of functions, possibly nonlinear, that describe the forward and reverse mapping to a linear range (see `set nonlinear`) Nonlinear x/y axis demo * The familiar command `set logscale` has been reimplemented as a special case nonlinear axis where the paired functions are log(x) and exp(x). * Inside the bracketed clause of an iteration, `continue` jumps immediately to the next iteration, `break` immediately exits from the iteration * `toggle { | "plottitle" | all}"` interactively enables or disables display of one element of the current plot (see `toggle`) * `save fit` replaces deprecated command `update` * `set table "outfile.name" append` will append subsequent tabulated plots to an existing text file rather replacing its contents * `set pm3d lighting` describes a lighting model with specular highlighting (see `lighting`) * `set minussign` tells gnuplot to use a special symbol in the current encoding to replace the ascii character '-' in negative numbers * `set micro` tells gnuplot to use a special symbol in the current encoding to replace the ascii character 'u' for the scientific notation prefix "micro" The special typographic symbols for micro and minussign are used only in axis tic labels and strings explicitly created with gprintf(). The byte sequence used to represent these characters depends on the current encoding. * This gnuplot version introduces a new data type `array name[size]`. An array must be declared before use. Each array element A[i] may be a string, an integer, a real number, or a complex value. A single array may contain elements with different types. The cardinality operator |A| returns the size of array A. See `arrays`. * See `sixelgd` for description of a new terminal that supports interleaving plots with the command lines that generated them if gnuplot is run inside a vt340-compatible terminal emulator * The `domterm` terminal supports interleaving plots with the command lines that generated them if gnuplot is run inside an svg-aware terminal emulator * The `windows` terminal supports saving the current graph to a bitmap file * The `windows` terminal graph window can be docked to the wgnuplot text window * New (experimental) Direct2D/DirectWrite backend for the `windows` terminal * The `wxt` terminal supports exporting to an EMF file or printer on Windows * The `dumb` terminal supports ANSI colors for lines and fill area * The `tkcanvas` terminal has been rewritten to support many more modern gnuplot features, as well as new languages. (Since 5.0.3) * An additional rotation angle `azimuth` affects the orientation of 3D plots. This can be set from the command line (see `set view azimuth`) or by dragging with the right mouse button. * gnuplot running under Windows can interpret Unicode (BMP) input scripts by converting them to the current encoding from `set encoding`, including UTF-8 * Textboxes can be assigned a border color and fill color (see `set style textbox`) * Customized plot legends (see `plot title`, `set key`, `multiple keys`) * A sampling range specifier for plotting with pseudofile '+' can include a sampling interval. For example: plot sample [t=0:100:10] '+' using (t):(1):(label[t]) with labels * Pseudo-file '++' generates samples on the u and v axes, rather than x and y. This allows placement of multiple parametric surfaces in 3D that occupy distinct regions of Cartesian space. See `sampling.dem`. * new formats descriptors tH tM tS handle relative times (interval lengths). See `time_specifiers`. * ^R initiates a reverse-search through the history for the built-in readline which is used on Windows, too, see `command-line-editing`. * Revised printing support on Windows using `set output "PRN"`, see `windows printing`. * The dot-dash pattern of a line can now be specified independent of other line properties. See `dashtype`, `set dashtype`, `set linetype` * The default sequence of colors used for successive elements in a plot is more easily distinguished by users with color-vision defects. The color sequence is under user control (see `set colorsequence`). This mechanism can also be used to generate monochrome plots (see `set monochrome`). In previous gnuplot versions `monochrome` could only be selected when changing the current terminal via `set terminal`. * New plot styles `with parallelaxes`, `with table`, and labeled contours. * New data pre-processing filter for monotonic cubic splines (see `smooth mcsplines`) * Text markup now supports bold and italic font settings in addition to subscript, superscript, font size and other previously available properties. Enhanced text mode is now enabled by default. See `enhanced text`. Text elements can be enclosed in a box (see `set style textbox`). * Interactive terminals support hypertext labels that only appear when the mouse hovers over the label's anchor point. * New coordinate system (Degrees, Minutes, Seconds). See `set xtics geographic`. * The default format for axis labels is "% h" ("$%h$" for LaTeX terminals). This format is like the C standard format %g except that the exponential term, if present, is written using a superscript. E.g. 1.2 x 10^5 rather than 1.2E05. * Command scripts may place in-line data in a named data block for repeated plotting. See `inline data`. * Support for 32-bit Alpha channel + RGB color #AARRGGBB. See `colorspec`. * Support for HSV color space via a translation function hsv2rgb(H,S,V). * Secondary axes (x2, y2) may be locked to the primary axis via a mapping function. In the simplest case this guarantees that the primary and secondary axis ranges are identical. In the general case it allows you to define a non-linear axis, something that previously was possible only for log scaling. See `set link`. * Each function in a plot command may optionally be preceded by a sampling range. This does not affect the overall range of the plot, only the range over which this function is sampled. See `plot` and `piecewise.dem`. * If the external library libcerf is available, it is used to provide complex math routines cerf, cdawson, erfi, faddeeva, and the Voigt profile VP(x,sigma,gamma). * The `import` command attaches a user-defined function name to a function provided by an external shared object (support is operating-system dependent). A template header and example source and make files for creating a suitable external shared object are provided in the demo collection. * Previous commands in the history list of an interactive session can be reexecuted by number. For example, `history !5` will reexecute the command numbered 5 in the `history` list. * Bit-shift operators >> and <<. * Shell invocation of gnuplot can pass parameters to a gnuplot script. gnuplot -c scriptfile.gp ARG1 ARG2 ARG3 ... ?changes ?differences Some changes introduced in version 5 may cause certain scripts written for earlier versions of gnuplot to behave differently. * Revised handling of input data containing NaN, inconsistent number of data columns, or other unexpected content. See Note under `missing` for examples and figures. * Time coordinates are stored internally as the number of seconds relative to the standard unix epoch 1-Jan-1970. Earlier versions of gnuplot used a different epoch internally (1-Jan-2000). This change resolves inconsistencies introduced whenever time in seconds was generated externally. The epoch convention used by a particular gnuplot installation can be determined using the command `print strftime("%F",0)`. Time is now stored to at least millisecond precision. * The function `timecolumn(N,"timeformat")` now has 2 parameters. Because the new second parameter is not associated with any particular data axis, this allows using the `timecolumn` function to read time data for reasons other than specifying the x or y coordinate. This functionality replaces the command sequence `set xdata time; set timefmt "timeformat"`. It allows combining time data read from multiple files with different formats within a single plot. * The `reverse` keyword of the `set [axis]range` command affects only autoscaling. It does not invert or otherwise alter the meaning of a command such as `set xrange [0:1]`. If you want to reverse the direction of the x axis in such a case, say instead `set xrange [1:0]`. * The `call` command is provides a set of variables ARGC, ARG0, ..., ARG9. ARG0 holds the name of the script file being executed. ARG1 to ARG9 are string variables and thus may either be referenced directly or expanded as macros, e.g. @ARG1. The contents of ARG0 ... ARG9 may alternatively be accessed as array elements ARGV[0] ... ARGV[ARGC]. An older gnuplot convention of referencing call parameters as tokens $0 ... $9 is deprecated. * The optional bandwidth for the kernel density smoothing option is taken from a keyword rather than a data column. See `smooth kdensity`. ?deprecated syntax ?backwards compatibility ?compatibility Gnuplot version 4 deprecated certain syntax used in earlier versions but provided a configuration option that allowed backward compatibility. Support for the old syntax has now been removed. Deprecated in version 4 and removed in version 5: set title "Old" 0,-1 set data linespoints plot 'file' thru f(x) plot 1 2 4 # horizontal line at y=1 update Current equivalent: TITLE = "New" set title TITLE offset char 0, char -1 set style data linespoints plot 'file' using 1:(f(column(2))) plot 1 linetype 2 pointtype 4 save fit "filename" Deprecated in version 5 if (defined(VARNAME)) ... set style increment user call 'script' 1.23 ABC (in script: print $0, "$1", "number of args = $#") set fontpath set clabel fit control variables FIT_* Current equivalent: if (exists("VARNAME")) ... set linetype call 'script' 1.23 "ABC" (in script: print ARG1, ARG2, "number of args = ", ARGC set cntrlabel set fit