Skip to content

gnuplot Subset ​

foresight interprets a subset of the gnuplot command language, documented here by topic. Everything outside it is an error naming the command and its line (script.gp:12: unsupported command "history"), never silently ignored: a script that runs is a script that did what it says. The commands that act on gnuplot's interactive windows only (bind, set mouse, vclear, test, set term push) are accepted and do nothing, as with gnuplot's file terminals. Path E is the guide for gnuplot users.

Syntax ​

  • One statement per line, or several separated by ;
  • # starts a comment (outside quotes)
  • A line ending with \ continues on the next one
  • Strings in single quotes are literal; in double quotes \t is a tab, \n a new line (an x tick label on two lines; a blank in titles and labels) and \ takes the next character literally (\", \\)
  • @name (outside quotes) is replaced by the value of the string variable name, a gnuplot macro: cmd = 'set logscale y'; @cmd
  • A line $NAME << WORD starts a datablock, its lines read as they are up to one starting with WORD
  • `command` (outside single quotes, inside double ones too) is replaced by the standard output of the shell command, its last newline dropped: n = `wc -l < run.dat` , see Shell commands
  • Keywords accept gnuplot abbreviations: the shortest accepted form is in bold below

Topics ​

PageSections
Commands and settingsCommands, set / unset options, Shell commands, reset and pause, Print, Fit, Stats
Plot itemsplot items, Iteration, Parametric plots, Clipping
DataExpressions in using, String columns, Column headers, Tables, Time data, Smoothing
StylesStyles, Lines, steps and impulses, Box, finance and boxplot styles, Vectors, ellipses, polygons, labels and sectors, Point types, Boxes and filled curves, Histograms, Readouts, Circles, pies and donuts, Gauges, radars and roses, Parallel axes and spider plots, Themes and segmented fills
Axes, ticks and layoutSecond y axis, Second x axis, Ticks and label formats, Key, Grid, zero axes and border, Margins, Multiplot, Polar plots
Text and fontsLabels, arrows and objects, Fonts, Enhanced text
Images, palettes and 3DImages and palettes, 3D plots
ScriptingUser variables and functions, Strings, Datablocks and scripts, Arrays, Function blocks, Blocks and loops, Functions, Special functions

Not supported ​

fit beyond its subset, log bases other than 10; the rtics placement options; in set xtics, positions and a list together (set xtics 0,1 ("a" 2)), rotate of the color box labels, out of the color box ticks, axis of the x2 and y2 ticks; the complex forms of the special functions (gnuplot's Ai, BesselJ, ...) and those of libcerf (VP, erfi, FresnelC, ...); in enhanced text, the fonts and the super and subscripts of the text devices; in set format, gnuplot's geographic formats; set datafile options other than separator, missing, commentschars and columnheaders; lc variable and lc palette z with boxplot, set style boxplot labels x2; the blank key rows of newhistogram groups; the line gap of a negative pointinterval or pointnumber; reread (deprecated in gnuplot 6.0), arrays as function arguments; the smooth filters unwrap, the kdensity period option and smoothing on log axes in log space; the block character sets dot, octants, sextpua, octpua, and its optimize, attributes, charpoints, gppoints, animate options; set multiplot scale, offset; palette models other than RGB, HSV and CMY; keyentry with the panel charts other than spider plots (pies, ...); fillsteps options (above, below, y=); set minussign and set micro with set encoding utf8.

foresight is available under your choice of license: GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT (License).