Skip to content

foresight_script ​

foresight_script, interpreter of a gnuplot command subset.

Supported (with gnuplot abbreviations):

  • NAME = expression (a user variable, its value now), NAME(P1, ...) = expression (a user function, see foresight_expression); expressions take them everywhere, range ends included (set xrange [0:2*pi]);
  • set|unset title|xlabel|ylabel|y2label|x2label ["text"], set xrange|yrange|y2range|x2range [min:max] (* or empty autoscales an end), set|unset logscale [AXES] (AXES concatenates x, y, y2, x2, cb, e.g. xy2; all when absent), set|unset grid, set|unset key, set output "file", set terminal svg|html [size W,H] [refresh SECONDS];
  • set terminal dumb [size COLS,ROWS] [mono|ansi|ansi256|ansirgb] (text, default 79x24 on standard output -), set terminal block [half|quadrants|sextants|braille] [size COLS,ROWS] [mono|ansi|ansi256|ansirgb] (text drawn with Unicode block or Braille characters);
  • set|unset multiplot [layout ROWS,COLS] [title "t"]: each plot fills the next panel, settings carry over; without layout each panel lies in its set origin X,Y / set size W,H box (page fractions); in a layout they give the next panel its own box, as gnuplot;
  • set xtics|ytics|y2tics|x2tics [auto|STEP|START,STEP[,END]] [mirror|nomirror] (y2 and x2 ticks are off until set), unset xtics|ytics|y2tics|x2tics, set format [AXES] ["fmt"], unset format, set key [on|off] [left|right|center] [top|bottom|center] [box|nobox] [autotitle [columnhead]|noautotitle], set style data|function STYLE, unset style function, set style line N [lc ...] [lt N] [lw W] [dt N] [pt N] [ps S];
  • set datafile separator [whitespace|tab|comma|"chars"], unset datafile [separator]; set samples N[,M];
  • plot 'file' [using [X:]Y[:...]] [index N] [every I:J:K:L:M:N] [with STYLE] [title "t"|notitle] [axes x1y1|x1y2|x2y1|x2y2] [smooth FILTER] [bins[=N] [binrange [LO:HI]] [binwidth=W] [binvalue=sum|avg]] [lc [rgb] "color"|N] [lw W] [dt N] [pt N] [ps S], ... ('' repeats the previous file; smooth and bins: see foresight_smooth), STYLE lines|points|linespoints|impulses|steps|fsteps|histeps|dots|yerrorbars|xerrorbars|xyerrorbars|yerrorlines| xerrorlines|xyerrorlines (error bars: x:y:dy or x:y:low:high, x:y:dx:dy or x:y:xlow:xhigh:ylow:yhigh), abbreviated as gnuplot (foresight_style); replot [items]; a using field is a column number or a parenthesized expression, ($2*1e3) (see foresight_expression), or a column header name, "residual"; title columnhead[(N)] titles an item with a column header; ls N, lt N in an item apply a line style, a linetype color; set colorsequence default|podo|classic|NAME [N] picks the linetype colors (NAME: a categorical order, batlowS, ...);
  • with boxerrorbars|boxxyerror|candlesticks [whiskerbars [F]]|financebars|boxplot (gnuplot's layouts), set style boxplot [range R|fraction F] [[no]outliers] [pointtype P] [candlesticks|financebars] [medianlinewidth W] [separation S] [labels off|auto|x] [sorted|unsorted];
  • with vectors|arrows [head|heads|nohead|backhead] [filled|empty|nofilled|noborder] [size [SYS] L,A] [fixed] [as|arrowstyle N], with ellipses [units xy], with polygons, with labels [left|center|right] [rotate by A] [offset X,Y] [point] [tc "c"] (using x:y:N, the text of column N), with sectors (gnuplot's layouts); unset xrange|yrange|y2range autoscales;
  • with parallelaxes [at X], set|unset spiderplot, with spiderplot (using Y[:key(N)], an axis per item, a line or polygon per row), set paxis N range [min:max]|tics [...]|label "t", unset paxis N tics, set style spiderplot [fs FILL] [lw W] [pt N] [ps S], set grid spiderplot;
  • with boxes (using x:y[:width], from y = 0), with filledcurves [closed|x1|x2|y=V|xy=X,Y] [above|below] (using x:y1:y2 for a band), with rgbimage|rgbalpha (x:y:r:g:b[:a]), set|unset rgbmax V, fs|fillstyle FILL in an item, set style fill FILL (FILL: empty, [transparent] solid [D], pattern [N], border [lc C|-1], noborder), set boxwidth [W] [absolute|relative], unset boxwidth;
  • with histograms (using Y[:xtic(N)], the rows at the point numbers 0, 1, ...), set style histogram clustered [gap G]|errorbars [gap G] [lw W]|rowstacked|columnstacked (errorbars: using Y:ERR or Y:LOW:HIGH; columnstacked: key(N) the row names), plot newhistogram ["title"] [lt N] [fs FILL] [at X], ... groups; using ...:xtic(N) / xticlabels(N): the text of column N labels the abscissae, the labels replacing the x ticks; xtic(EXPR) a string expression (strcol(1) . ' K'); x2tic, ytic, y2tic likewise on their axis (the ordinates for y and y2; x2 and y2 once their ticks are set); pi|pointinterval N a marker every N points, pn|pointnumber N about N; pt "c" a character as the point (tc its color, font ignored); set errorbars [small|large|fullwidth|SIZE] [lc C] [lw W], unset errorbars;
  • string columns in using expressions: strcol(N), stringcolumn(N) (N a number or a header name), columnhead(N), the pseudo-columns column(-1) (block) and column(-2) (dataset); the text of labels a column or an expression;
  • plot 'file' [matrix] with image (using x:y:z on a regular grid, or the values of a matrix file), set palette [rgbformulae R,G,B|defined (v c, ...)|cubehelix [start S] [cycles C] [saturation S]|file 'f' [index N] [every E] [using U]|gray|grey|color|NAME|positive| negative|maxcolors N|model RGB] (NAME: a named palette of foresight_colormaps, viridis, batlow, ..., any case), set cbrange [min:max], set|unset cblabel ["t"], set|unset colorbox [vertical|horizontal] [default|user] [origin X,Y] [size W,H] [border|bdefault|noborder] [invert|noinvert] [front], set|unset cbtics, set format cb, set|unset logscale cb;
  • with circles (using x:y[:r[:start:end]], wedges with angles in degrees); foresight's with pie [donut F] (using Y[:xtic(N)], alone in its panel);
  • foresight's panel charts: with gauge range [A:B] [segments N] [format "fmt"], with radar, with rose [linear] (using Y[:xtic(N)]), alone in their panel (several gauges or radars side by side);
  • set|unset polar (items theta:r, functions of t over set trange [min:max]), set angles degrees|radians (also the trigonometric functions of the expressions), set|unset theta [right|top|left|bottom] [clockwise|cw| counterclockwise|ccw], set rrange [min:max], set|unset rtics [...] (as xtics), set|unset ttics [[START,]STEP] [format "fmt"], set|unset raxis, set grid [polar [STEP]], set border [MASK] [polar], unset border, set size [square|nosquare|ratio R|noratio] [W,H];
  • foresight extensions: set terminal ... theme classic|vfd|lcd|washi|night [glow|noglow] (any terminal), the colors of a 1980s display or of foresight's identity (see foresight_theme); fs ... segments N, bars cut into N cells over the y range (foresight_style); plot ... with readout [format "fmt"], the last finite value of the item in seven-segment digits on a glass of fmt (a printf conversion with a field width, %10.3e by default; see foresight_readout), lc its only style option; set readout [on|off] [left|right|center] [top|bottom|center] [horizontal|vertical] [opaque|noopaque] [size H], unset readout;
  • set label [N] "text" at POS ..., set arrow [N] from POS to|rto POS ..., set object [N] rectangle|circle|ellipse| polygon ..., unset label|arrow|object [N], set style arrow N ..., unset style arrow, set style rectangle ... (see annotation_option, foresight_annotations);
  • time data: set xdata|ydata|x2data|y2data [time] (the x or y field read with set timefmt "fmt", the axis ticked and labelled in time units), set format x "%H:%M" [timedate|numeric], time strings as range ends and tick positions, timecolumn(N[, "fmt"]), strftime(fmt, t), strptime(fmt, s), time(0) (see foresight_time);
  • datablocks $NAME << WORD (the lines up to one starting with WORD) plotted, fitted, stated as a file (plot $D), print $NAME, load FILE, call FILE ARG1 ... (ARG0..ARG9, ARGC, restored after it), eval STRING, macros @name (a string variable's value), undefine NAME|NAME*|$NAME; $NAME[i] a line of a datablock, |$NAME| their number; inline data '-' of plot, replot, fit and stats (the lines after the statement up to one starting with e, one block per item);
  • arrays: array A[N], array A[N] = [E1, ...], array A = [E1, ...] (elements of any type, some possibly without a value), A[i] = E, A[i] and |A| in expressions (an index of a data row resolved on each row), index(A, V), print A, plot A and stats A (the index and the value of each element, as a file), ARGV (the arguments of call and foresight -c);
  • system("command") (its standard output, run when the expression is compiled), system "command", `command` substitution outside single quotes; reset [session|errors|bind] (see reset_command); set table ["file"|$NAME] [append], unset table (plots write their points as text, see write_table); pause SECONDS|-1|mouse ["message"] (see pause_command); reread is an error, deprecated in gnuplot 6.0;
  • a function of x as a plot item, plot sin(x)/x title "sinc" (same options, styles lines, points or linespoints, set style function, lines by default): sampled at set samples points (100) over the x range before its extension to the ticks, the data extent, or [-10:10] with neither; evenly in log x on a log axis.
  • the pseudo-files '+' (samples of a variable, column 1) and '++' (a u, v grid, columns 1 and 2), plot sample [t=a:b:step] '+' using (t):(f(t)), an item's [name=a:b:step]; set urange, set vrange, set isosamples (the '++' grid; surfaces otherwise), unset trange|rrange|urange|vrange.
  • read and ignored, as they leave gnuplot's 2D svg output unchanged: set|unset mouse, set|unset macros (macros always on), set pointintervalbox, set zrange, set|unset minussign and set|unset micro with the default encoding (rejected with utf8, where gnuplot changes the signs); refresh is replot without new items; set|unset overflow [float|undefined|NaN] (integer overflow, see foresight_expression), set|unset mttics [N] (minor ticks on the polar border), unset samples (100).

Anything else is an error naming the command, never silently ignored. Errors are returned (iostat, iomsg with source:line:), not stopped on, so a watch loop can survive a bad cycle.

Source: src/lib/foresight_script.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
DUMB_CELLreal(kind=R8P)parameterText device cell size [font size].
FOREVERinteger(kind=I4P)parameterValues of an unbounded plot iteration, for [i=A:*], at most.
LC_VARIABLEcharacter(len=12)parameterlc variable marker in a line color.
LC_RGB_VARIABLEcharacter(len=12)parameterlc rgb variable marker in a line color.
warned_familiescharacter(len=1024)saveFont families warned about (not compiled in), |name| each.
LC_PALETTE_Zcharacter(len=12)parameterlc palette [z] marker in a line color.
PI_SCRIPTreal(kind=R8P)parameterpi.
LC_PALETTE_CBcharacter(len=12)parameterlc palette cb V marker in a line color.
LC_PALETTE_FRACcharacter(len=12)parameterlc palette frac F marker in a line color.
FUNCTION_STYLEScharacter(len=*)parameterStyles drawing functions.
activeclass(script_object)pointerThe interpreter running (function blocks run in it).

Derived Types ​

line_style_object ​

Line properties: a set style line, or the options of a plot item; unallocated means the default.

Components

NameTypeAttributesDescription
idinteger(kind=I4P)Style number.
lccharacter(len=:)allocatableColor.
lwreal(kind=R8P)allocatableLine width.
dtinteger(kind=I4P)allocatableDash type.
psreal(kind=R8P)allocatablePoint size.
ptinteger(kind=I4P)allocatablePoint type.
piinteger(kind=I4P)allocatableA point every N (pointinterval).
palettereal(kind=R8P)Value of lc palette cb V or frac F.
pt_charcharacter(len=:)allocatableA character as the point (pt "c").
pninteger(kind=I4P)allocatableAbout N points evenly spread (pointnumber).
colormapcharacter(len=:)allocatableA named colormap (lc palette NAME).
ptdefinteger(kind=I4P)Default point type from lt N/ls N (gnuplot), 0 if none.

polar_grid_type ​

gnuplot's set polar grid: the polar grid of with surface and the weighting of the data on it.

Components

NameTypeAttributesDescription
theta_segmentsinteger(kind=I4P)Angular segments.
r_segmentsinteger(kind=I4P)Radial segments.
modeinteger(kind=I4P)Weighting: 1 qnorm, 2 gauss, 3 cauchy, 4 exp, 5 box.
norm_qinteger(kind=I4P)qnorm power.
kdensitylogicalSums of weights (a kernel density), not weighted means.
scalereal(kind=R8P)Distance scale of the kernels.
rminreal(kind=R8P)Radial clipping start (r [min:max]).
rmaxreal(kind=R8P)Radial clipping end.
tminreal(kind=R8P)Angular clipping start [deg] (theta [min:max]).
tmaxreal(kind=R8P)Angular clipping end [deg].

loop_level ​

One for [...] clause of a plot item: its variable, values, the value in use and the variable before the loop.

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableLoop variable.
valuestype(token_object)allocatableValues, as text.
wordslogicalString values.
posinteger(kind=I4P)Value in use.
savedtype(saved_variable)The variable before the loop.
foreverlogicalfor [i=A:*]: until an item yields no valid point.
clausecharacter(len=:)allocatableThe clause, evaluated again when an outer variable moves.
dependentlogicalBounds depending on an outer variable.

local_state ​

A variable made local in a function block: its state before, restored when the block ends.

Components

NameTypeAttributesDescription
vtype(saved_variable)The variable of the name.
atype(saved_array)The array of the name.

script_object ​

Script interpreter state.

Components

NameTypeAttributesDescription
figuretype(figure_object)Figure being built.
outputcharacter(len=:)allocatableCurrent output file.
output_setlogicalOutput set by set output.
default_outputcharacter(len=:)allocatableThe output given at init, back after a bare set output.
previous_filecharacter(len=:)allocatableFile of the last plot item, for ''.
last_plotcharacter(len=:)allocatableItems of the last plot, for replot.
data_filestype(token_object)allocatableData files read, for watching.
live_refreshinteger(kind=I4P)HTML reload period applied when none is set [s].
multiplotlogicalInside set multiplot.
layout_keptlogicalAn origin and size set before a multiplot layout.
kept_originreal(kind=R8P)That origin, back after unset multiplot.
kept_sizereal(kind=R8P)That size, back after unset multiplot.
parametriclogicalgnuplot set parametric: function items in pairs, x(t), y(t) over trange.
advance_pendinglogicalA multiplot panel was plotted: the next command opens the next panel.
data_stylecharacter(len=:)allocatableDefault plot style, set style data.
function_stylecharacter(len=:)allocatableDefault function style, set style function.
autotitlecharacter(len=:)allocatableUntitled items: file (as written), columnhead, none (gnuplot set key [no]autotitle).
line_stylestype(line_style_object)allocatableset style line definitions.
polar_gridtype(polar_grid_type)set polar grid.
separatorcharacter(len=:)allocatableData cell separators, empty for whitespace.
missingcharacter(len=:)allocatableMissing data string, empty for none.
commentscharacter(len=:)allocatableCharacters starting a comment in data files.
textbox_drawnlogicalset style textbox [N]: the boxed texts of style N have their box (opaque, or a border: gnuplot's svg draws the background then).
column_headerslogicalset datafile columnheaders: the first row of each dataset is a header.
samplesinteger(kind=I4P)Function samples, set samples.
rgbmaxreal(kind=R8P)Full intensity of RGB image components, set rgbmax.
binary_countinteger(kind=I4P)Datablocks made of binary files ($__binaryN).
vgridstype(vgrid_object)allocatableVoxel grids (set vgrid $name).
vgrid_activeinteger(kind=I4P)The active one, 0 for none.
iso_triangleslogicalset isosurface triangles (else mixed).
iso_insideinteger(kind=I4P)set isosurface insidecolor N (read, unused).
chi_fractionreal(kind=R8P)Default concave hull length, a fraction of the longest convex hull edge (set chi_shape fraction).
symbolstype(symbols_object)User variables and functions, a = 2, f(x) = ....
fit_optionstype(fit_settings)set fit limit, maxiter, lambda, scaling options.
fit_verbositycharacter(len=7)set fit quiet|results|brief: the report on the standard error (none by default, unlike gnuplot).
fit_logfilecharacter(len=:)allocatableset fit logfile, empty for none (the default).
fit_errorvariableslogicalset fit errorvariables: NAME_err set.
fit_covariancevariableslogicalset fit covariancevariables: FIT_COV_A_B set.
timefmtcharacter(len=:)allocatableInput time format, gnuplot set timefmt.
time_datalogicalTime data on x, y, y2, x2 (set xdata time).
print_filecharacter(len=:)allocatableset print: '' the standard error (gnuplot's default), '-' the standard output, else a file.
loop_depthinteger(kind=I4P)Loops (do for, while) being run.
loop_signalinteger(kind=I4P)break (1) or continue (2) pending, else 0.
tablelogicalset table: plots write their points as text.
arrow_stylestype(arrow_object)allocatableset style arrow N definitions (their tags).
rectangle_styletype(shape_object)set style rectangle: new rectangles' style.
table_filecharacter(len=:)allocatablestandard output.
table_sepcharacter(len=1)set table separator, of plot with table.
block_depthinteger(kind=I4P)Function blocks running.
returnedlogicalreturn EXPR gave the running block a value.
return_valuetype(value_object)That value.
localstype(local_state)allocatableVariables made local by the running blocks.
encodingcharacter(len=:)allocatableset encoding: GPVAL_ENCODING, default or utf8.
minus_signlogicalset minussign: no effect with the default encoding.
micrologicalset micro: no effect with the default encoding.
term_namecharacter(len=:)allocatableThe terminal: GPVAL_TERM.
exit_statusinteger(kind=I4P)exit status N: the status the run ends with.
dummycharacter(len=:)allocatableset dummy NAME: the functions' variable, empty for gnuplot's (x, t in polar mode).
isosamplesinteger(kind=I4P)set isosamples N,M: M, the v samples of '++' and the iso-curves of y of the splot functions.
isosamples1integer(kind=I4P)N: the iso-curves of x of the splot functions.
samples2integer(kind=I4P)set samples N,M: M, the samples along y of the splot functions' iso-curves of x.
last_splotlogicalThe last plot a splot (for replot, refresh).
uv_rangereal(kind=R8P)set urange, set vrange (columns u, v).
data_curvecharacter(len=:)allocatableset style data filledcurves OPTIONS: the options of the data filledcurves given none.
function_curvecharacter(len=:)allocatableThe same of the functions (set style function).
colormap_namescharacter(len=64)allocatableNamed colormaps (set colormap new NAME).
mappinginteger(kind=I4P)set mapping: 0 cartesian, 1 spherical (theta, phi, r), 2 cylindrical (theta, z, r) splot data.
dummiescharacter(len=:)allocatableset dummy names, blank separated (the variables of a fit of several), empty for gnuplot's x y.
colormapstype(colormap_object)allocatableTheir palettes and ranges.

Type-Bound Procedures

NameAttributesDescription
executepass(self)Execute one statement.
initpass(self)Reset the interpreter.
run_filepass(self)Run a script file.
run_textpass(self)Run script text.
assignmentpass(self)a = 2, f(x) = ....
plot_commandpass(self)plot.
plot_itemspass(self)plot items, binary files as datablocks.
binary_itemspass(self)Binary files of plot items as datablocks.
sparse_itemspass(self)Sparse matrices of plot items as datablocks.
matrix_header_itemspass(self)Matrices with headers of plot items as datablocks.
reset_commandpass(self)reset.
pause_commandpass(self)pause.
write_tablepass(self)The points of a plot as text (set table).
fit_commandpass(self)fit.
print_commandpass(self)print.
stats_commandpass(self)stats.
load_datapass(self)Load a data file or a datablock.
set_time_datapass(self)set xdata time, set xdata.
range_valuepass(self)Value of a range end.
colormap_indexpass(self)Index of a named colormap, 0 if none.
annotation_optionpass(self)set label, set arrow, set object.
wall_optionpass(self)set wall.
call_commandpass(self)load, call.
expand_macrospass(self)@name substitution.
do_blockpass(self)do for [...] { ... }.
set_forpass(self)set for [...] OPTION, unset for [...] OPTION.
while_blockpass(self)while (...) { ... }.
if_blockpass(self)if (...) { ... } else ....
run_bodypass(self)The statements of a block.
old_if_linepass(self)gnuplot's old one-line if.
run_listpass(self)Statements in order.
run_loopspass(self)Nested for clauses of a block.
string_expressionpass(self)A string expression across tokens.
string_argumentpass(self)The string after a set option.
text_colorpass(self)The color after tc.
register_filepass(self)Remember a data file.
save_outputpass(self)Render to the current output.
set_commandpass(self)set.
unset_commandpass(self)unset.
exit_commandpass(self)exit, quit.
vgrid_indexpass(self)A voxel grid by name.
vgrid_rangespass(self)The active voxel grid's ranges.
voxel_optionpass(self)set vgrid, set vxrange..., set isosurface.
voxel_statementpass(self)unset vgrid, vclear, voxel(...) =, vfill.
voxel_itemspass(self)splot items of voxel grids as datablocks.

script_model ​

A fit model: a user expression of x whose parameters are user variables, set and the expression compiled again for each parameter vector (a user variable is a constant of a compiled expression).

Inheritance

Extends: fit_model

Components

NameTypeAttributesDescription
textcharacter(len=:)allocatableModel expression.
namescharacter(len=32)allocatableParameter names.
xreal(kind=R8P)allocatableAbscissae.
degreeslogicalAngles in degrees.
symbolstype(symbols_object)User variables and functions, a copy of the script's.
xsreal(kind=R8P)allocatableIndependent variables of each point (point, variable), several.
varscharacter(len=:)allocatableTheir names, blank separated (columns 1, 2, ... of a row).

Type-Bound Procedures

NameAttributesDescription
valuespass(self)Values at the abscissae.
slopespass(self)Slopes at the abscissae (xyerrors).

Interfaces ​

push ​

Append an item through a temporary: nvfortran 26.9 corrupts list = [list, item] (and any list = f(list)) when the items hold deferred-length characters.

Module procedures: push_line_style

Subroutines ​

init ​

Reset the interpreter; plots go to output until set output, in the output theme (see foresight_theme, blank or absent: classic) until set terminal ... theme.

fortran
subroutine init(self, output, theme)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
outputcharacter(len=*)inDefault output file.
themecharacter(len=*)inoptionalDefault output theme.

Call graph

gnuplot_values ​

gnuplot's GPVAL_* variables of foresight: the gnuplot version it follows (6.0, patchlevel 0), its compile options (only those of gnuplot that foresight has: scripts test them to skip what is missing), the encoding, the terminal and the terminals, the system.

fortran
subroutine gnuplot_values(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.

Call graph

store_variable ​

An assignment run by an expression (foresight_expression's store_hook), (a = 2, a + 1): the variable of the active interpreter set.

fortran
subroutine store_variable(name, v)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inVariable name.
vtype(value_object)inValue.

Call graph

store_element ​

An array element assigned by an expression (foresight_expression's element_hook), (A[$0+1] = $2): the element of the active interpreter's array set, ok false if out of range.

fortran
subroutine store_element(name, i, v, ok)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inArray name.
iinteger(kind=I8P)inElement.
vtype(value_object)inValue.
oklogicaloutStored.

Call graph

fetch_element ​

An array element read when an expression runs that assigns elements of it (foresight_expression's element_fetch_hook): the element of the active interpreter's array.

fortran
subroutine fetch_element(name, i, v, found, set)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inArray name.
iinteger(kind=I8P)inElement.
vtype(value_object)outValue.
foundlogicaloutIn range.
setlogicaloutWith a value.

Call graph

fetch_variable ​

The value of a variable an expression assigns, read when it runs (foresight_expression's fetch_hook).

fortran
subroutine fetch_variable(name, v, found)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inVariable name.
vtype(value_object)outValue.
foundlogicaloutA variable of that name.

Call graph

run_block ​

gnuplot 6.0 function block name called on args (foresight_expression's block_hook): its body run by the active interpreter with ARGC and ARGV the arguments (restored after), the variables made local restored when it ends; the value of its return, ok false if none (undefined) or if it failed (message). Parameter names. One name. End of the first line. Comma. Parameter counter.

Attributes: recursive

fortran
subroutine run_block(name, args, result, ok, message)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inBlock name.
argstype(value_object)inArguments.
resulttype(value_object)outReturned value.
oklogicaloutA value returned.
messagecharacter(len=:)outallocatableError, empty if none.

Call graph

run_file ​

Run the script file. With args (as gnuplot's gnuplot -c FILE ARG1 ...), ARG0 is the file name, ARG1 to ARG9 the arguments (empty beyond them), ARGC their number.

Attributes: recursive

fortran
subroutine run_file(self, file, iostat, iomsg, args)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
filecharacter(len=*)inScript file.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
argscharacter(len=*)inoptionalScript arguments, at most 9.

Call graph

run_text ​

Run script text: lines ending in \ continue on the next one; the first error stops the run. A line $NAME << WORD starts a datablock: the lines after it, as they are, up to a line starting with WORD; a line function $NAME << WORD a function block (gnuplot 6.0). A return ends the run. The definition after function. Opening parenthesis. Closing parenthesis. The <<.

Attributes: recursive

fortran
subroutine run_text(self, text, iostat, iomsg, source)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inouttargetInterpreter.
textcharacter(len=*)inScript text.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message, source:line: ....
sourcecharacter(len=*)inoptionalSource name for messages.

Call graph

execute ​

Execute one statement. Statement without leading blanks.

Returned value.

Variable name. Its state before. End of the name.

The statement, its leading blanks removed.

The variable's string. A string variable.

Attributes: recursive

fortran
subroutine execute(self, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inouttargetInterpreter.
statementcharacter(len=*)inStatement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

do_block ​

gnuplot do for [i = a:b[:c]] [for [...]] { ... } and do for [w in "words"] { ... }: the body run for each value, the clauses nested left to right; the loop variable is local to the loop (its value before is restored, or it is removed), bounds are truncated to integers, break leaves the whole do, continue its innermost clause.

Attributes: recursive

fortran
subroutine do_block(self, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inThe whole statement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

for_clauses ​

The leading for [...] clauses of rest (brackets removed), rest left after them.

fortran
subroutine for_clauses(rest, specs, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
restcharacter(len=:)inoutallocatableText, the clauses removed.
specstype(token_object)outallocatableClauses.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

set_for ​

gnuplot set for [i = a:b] OPTION ... and unset for [...] OPTION: the command run for each value of the clauses (nested left to right), the loop variable local to it, as do for.

Attributes: recursive

fortran
subroutine set_for(self, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inThe whole statement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

run_loops ​

Run clause level of specs, the inner clauses (or the body) for each of its values.

Attributes: recursive

fortran
subroutine run_loops(self, specs, level, body, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
specstype(token_object)infor clauses.
levelinteger(kind=I4P)inClause.
bodycharacter(len=*)inBlock body.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

for_values ​

The values of a for clause: var = a:b[:c] (integers, bounds truncated, c 1 by default) or var in "w1 w2" (the words of a string expression, words true).

fortran
subroutine for_values(self, text, var, values, words, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
textcharacter(len=*)inClause, brackets removed.
varcharacter(len=:)outallocatableLoop variable.
valuestype(token_object)outallocatableValues, as text.
wordslogicaloutin form: the values are strings.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

set_loop_variable ​

Set the loop variable name to value: a string (a word) or an integer in decimal.

fortran
subroutine set_loop_variable(self, name, value, is_string)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
namecharacter(len=*)inVariable.
valuecharacter(len=*)inValue.
is_stringlogicalinA string.

Call graph

while_block ​

gnuplot while (condition) { ... }: the body run while the condition (a number, not 0) holds.

Attributes: recursive

fortran
subroutine while_block(self, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inThe whole statement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

if_block ​

gnuplot if (condition) { ... } [else if (condition) { ... }]... [else { ... }]: the first block whose condition holds is run. gnuplot's old one-line form, if (condition) command, is old_if_line's.

Attributes: recursive

fortran
subroutine if_block(self, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inThe whole statement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

run_body ​

Run the statements of a block body, stopping at a break or a continue.

Attributes: recursive

fortran
subroutine run_body(self, body, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
bodycharacter(len=*)inBody.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

old_if_line ​

gnuplot's old one-line if (condition) command; ...; [else command; ...]: statements the if and the rest of its line; when the condition holds the commands up to an else run, else those after it (else if chains), as gnuplot 6.0 still runs it.

Attributes: recursive

fortran
subroutine old_if_line(self, statements, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementstype(token_object)inThe if and the statements after it on its line.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

run_list ​

Run statements in order (an old one-line if among them takes the rest), stopping at an error or a signal.

Attributes: recursive

fortran
subroutine run_list(self, statements, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementstype(token_object)inStatements.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

truth_of ​

Whether the constant expression condition holds (a number other than 0; a string is an error).

fortran
subroutine truth_of(self, condition, holds, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
conditioncharacter(len=*)inCondition.
holdslogicaloutTrue.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

stats_command ​

gnuplot stats [[xmin:xmax] ymax] FILE [using N[:M]] [index N] [every ...] [name "P"] [output|nooutput]: foresight_stats on the column (or the pair) as STATS_* variables (P_* with a name); the records with an undefined used value are invalid, those outside the ranges out of range. Silent unless output, unlike gnuplot: the report then goes where print writes (gnuplot's screen layout on the standard error or output, its name-tab-value lines in a set print file). Matrix. Submatrix. Its column indices. Its row indices. Matrix problem.

Pair statistics.

Column statistics.

First extreme, row by row.

fortran
subroutine stats_command(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inTokens after stats.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

gnuplot print EXPRESSION, ...: the values (strings as they are, numbers as gnuplot shows them) separated by a blank, on one line of the standard error, or where set print sends it. Datablock found.

Datablock lines. Datablock defined.

fortran
subroutine print_command(self, text, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
textcharacter(len=*)inText after print.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

fit_command ​

gnuplot fit max EXPRESSION 'file' [using X:Y[:ERR]] [index N] [every ...] [yerrors|unitweights] via P1, P2, ...: the parameters (user variables; an undefined one starts at 1) fitted by foresight_fit, then set to the result, with P_err (set fit errorvariables) and FIT_NDF, FIT_WSSR, FIT_STDFIT, FIT_P, FIT_NITER, FIT_CONVERGED. The report goes to the standard error with set fit results|brief, to a file with set fit logfile; silent by default. On failure the parameters keep their values. A line. Before the comment. File unit. Status. Equal sign. # FIXED.

gnuplot's dummy_old_default. The names grown (a temporary: nvfortran 26.9 corrupts a self-append). Position.

Parameter counter.

fortran
subroutine fit_command(self, tokens, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inTokens after fit.
statementcharacter(len=*)inThe whole statement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

script_model_values ​

The model at every abscissa, the parameters set as user variables of the model's own symbols.

fortran
subroutine script_model_values(self, p, f, ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_model)inoutModel.
preal(kind=R8P)inParameters.
freal(kind=R8P)outValues.
oklogicaloutAll defined.

Call graph

script_model_slopes ​

The slopes of the model (one variable) at every abscissa, gnuplot's calc_derivatives: one-sided, the step max(0.001 |x|, 8e-8 (|x| + 1e-8)).

fortran
subroutine script_model_slopes(self, p, f, dfdx, ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_model)inoutModel.
preal(kind=R8P)inParameters.
freal(kind=R8P)inModel values.
dfdxreal(kind=R8P)outSlopes.
oklogicaloutAll defined.

Call graph

set_parameter ​

Set the fit parameter name to v: a user variable, or an array element A[i] (gnuplot's via A[1], A[2]).

fortran
subroutine set_parameter(symbols, name, v)

Arguments

NameTypeIntentAttributesDescription
symbolstype(symbols_object)inoutSymbols.
namecharacter(len=*)inParameter.
vreal(kind=R8P)inValue.

Call graph

get_parameter ​

Value of the fit parameter name: a user variable or an array element A[i]; found false if none (or none set).

fortran
subroutine get_parameter(symbols, name, v, found)

Arguments

NameTypeIntentAttributesDescription
symbolstype(symbols_object)inSymbols.
namecharacter(len=*)inParameter.
vreal(kind=R8P)outValue.
foundlogicaloutA value found.

Call graph

binary_items ​

The plot tokens with each gnuplot binary array ('file' binary array=(W,H)|WxH [record=...] [format='%uchar...'] [flipx] [flipy] [flip=x|y] [dx=DX] [dy=DY] [origin=(X,Y)] [skip=N] [endian=little|big]) read into a datablock, one line per pixel: its fields (as the format: one specifier for every field, else one per field) then x and y (pixel i, j at origin + (i dx, j dy), the first scan line at the bottom unless flipped); the item's using prefixed by these x:y columns, or using x:y:1:...:N (N fields: rgbimage 3, rgbalpha 4, else the format's); a splot's (three_d) by x:y:(0), its pixels at z 0 (gnuplot's). center=(X,Y) moves the image's natural centre there; rotation=A (rotate, rot; A in radians, Ad degrees, Api multiples of pi) turns the pixels about that centre, or about the origin when origin= is given, as gnuplot's; an angle off the right ones makes each pixel a polygon of its four corners (with polygons, colored by its value through the palette, or by its packed RGB), as gnuplot draws rotated images. A splot's image in a 3D view (not the map) is drawn the same, each pixel a 3D polygon (lc rgb variable, the palette's color of its value over the set cbrange): in the xy plane at the z of center=(X,Y,Z) or origin=(X,Y,Z), or turned by perpendicular=(PX,PY,PZ) (gnuplot's rotation_matrix_3D: the image's normal along that vector), as gnuplot's df_readbinary. |p|. |p| in the xy plane. Scale.

A value written. Datablock text. Scan line. Pixel in it. Characters written. Width of a value.

Fields of a pixel. Pixel centre. Natural centre. Corner counter. Corners.

Corner from the reference, in the image's plane. The reference's place. The corner. The pixel centre. Coordinate.

The item's using. Its fields as expressions. Color expression. rgbimage or rgbalpha.

fortran
subroutine binary_items(self, tokens, three_d, items, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inItems tokens.
three_dlogicalinA splot.
itemstype(token_object)outallocatableTokens, binary files as datablocks.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

sparse_items ​

The plot tokens with each gnuplot sparse matrix ('file' sparse matrix=(C,R) [origin=(X0,Y0)] [dx=DX] [dy=DY]) read into a datablock, as gnuplot's populate_sparse_matrix: a grid of C x R cells at X0 + i DX, Y0 + j DY (origin 0,0, DX 1, DY = DX), every point of the item's using fields (1:2:3 by default) copied into the cell nearest to its x:y (rounded), the other cells undefined; the item reads using 1:2:... of the datablock. Unlike gnuplot, a point off its cell's centre is drawn at the centre (the image needs a regular grid).

fortran
subroutine sparse_items(self, tokens, items, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inItems tokens.
itemstype(token_object)outallocatableTokens, sparse matrices as datablocks.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

matrix_header_items ​

The plot tokens with each gnuplot matrix rowheaders|columnheaders file without its headers, a datablock in the same separator: the first row (columnheaders, its first cell a corner with rowheaders) names the columns, the first cell of each row (rowheaders) names the row; the names become x and y tick labels at the column and row numbers from 0, as gnuplot's: items of their own appended, $names using 1:2:xtic(3) (ytic) with points of size 0, untitled and out of the autoscaling. File size.

fortran
subroutine matrix_header_items(self, tokens, items, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inItems tokens.
itemstype(token_object)outallocatableTokens, the matrices as datablocks.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

plot_command ​

plot and splot (three_d) (plot_items), gnuplot's binary arrays ('file' binary array=...) first read into datablocks.

Attributes: recursive

fortran
subroutine plot_command(self, tokens, text, iostat, iomsg, three_d)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inItems tokens.
textcharacter(len=*)inText the tokens come from, for function titles.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
three_dlogicalinoptionalA splot.

Call graph

array_elements ​

The tokens of a plot command with each array name followed at once by its brackets (U[i], no blank between) joined into one word, the element: the tokenizer ends a word at [, a range of the plot otherwise. The tokens kept.

fortran
subroutine array_elements(self, tokens, text, merged)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
tokenstype(token_object)inTokens.
textcharacter(len=*)inThe statement.
mergedtype(token_object)outallocatableTokens, the elements joined.

Call graph

plot_items ​

plot items: each a data file or a function with modifiers, comma separated; replaces the previous plot and renders it.

Functions are sampled once all the items are read: their x range depends on the data of the whole plot, as gnuplot. Until then each holds its place (its color, its key row) as an empty series.

splot (splot_mode, gnuplot 6.0's): the items have a z, the third using field, read as the last column and kept apart (zfield), so that the other fields are the styles' plot fields; a function of x and y is sampled on its iso-curves (function_rows), a matrix becomes rows x y z (matrix_rows), both read as data. The series keep their heights and scans (attach_z): the blocks of the data, separated by blank lines. Last token of the item. Assignment error. Assignment status.

Constant value. Not a constant. Constant status. A string.

Function counter. First token of a function. The functions as fields.

First token of y(t). y(t) as written.

The first two names of set dummy. Read status.

A key(N) field.

The line.

Style number. The style.

Tokens, lt for the word. The linetype.

Tokens, lc for the word. Color read.

Opening parenthesis. Column.

Style number.

Color read.

Problem (none: checked when set).

The two dummy variables.

First name. Second name.

Generated rows.

Types column. The other columns. Column counter.

Sizes column. The other columns. Column counter.

Row.

Row.

Row.

The boxplot series. Linetype of the first factor. Factor counter. Distinct factors. Earlier label counter. A label met before.

The stack label on its first row.

Unknown word (none: checked by fill_ok).

Function.

fortran
subroutine plot_items(self, tokens, text, iostat, iomsg, splot_mode)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inItems tokens.
textcharacter(len=*)inText the tokens come from, for function titles.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
splot_modelogicalinA splot.

Call graph

call_command ​

gnuplot load FILE and call FILE [ARG1 ... ARG9]: run the script FILE (a string expression), ARG0 its name and, for call, ARGC the number of arguments and ARG1 to ARG9 their texts (a quoted string as it is, a number as written, a variable or a parenthesized expression its value: a string as it is, an integer as it is, a real as %g; any other word as it is, gnuplot's call "f" sub1), ARGV their values (numbers for the numbers, as gnuplot's prepare_call); those variables are restored after it. The script is watched as a data file is. The argument values.

Attributes: recursive

fortran
subroutine call_command(self, tokens, is_call, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inStatement tokens, the command first.
is_calllogicalincall, else load.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

pause_command ​

gnuplot pause SECONDS ["message"]: the message on the standard error, then a wait of SECONDS (0: none); -1 waits for a line on the standard input (its end does not wait). pause mouse [EVENTS] ["message"]: no mouse here, the message only, as gnuplot on a terminal without one. With a plot in a loop, while (1) { plot ...; pause 5 }, the output is rewritten every 5 s: gnuplot 6.0's live idiom.

fortran
subroutine pause_command(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inTokens after pause.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

reset_command ​

gnuplot reset [session|errors|bind]: the plot settings back to their defaults, as gnuplot 6.0 keeps the terminal, the output, set fit, set print, set table, the multiplot, the linetypes (set colorsequence) and, a quirk kept, set style data. reset session also forgets the user variables, functions and arrays (the script arguments kept) and restores the default linetypes; reset errors and reset bind do nothing here.

fortran
subroutine reset_command(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inTokens after reset.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

write_table ​

set table: the points of the current panel's series as gnuplot 6.0 tabulates them, a block per series (# Curve K of N, M points, its title, the column names) whose rows are the values in the axis formats (set format, % h by default) and a flag, i in range, o outside a fixed range, u undefined; the columns: x y type, with ylow yhigh (y error bars), xlow xhigh (x error bars, boxes), both (xy error bars), y1 y2 (filled curves between two curves) or x y label (labels). Lines, NaN separated. Level of each chunk. First chunk of its level. Chunk counter. Row. Level number.

fortran
subroutine write_table(self, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

expand_macros ​

gnuplot macros: each @name outside quotes replaced by the value of the string variable name.

fortran
subroutine expand_macros(self, statement, expanded, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
statementcharacter(len=*)inStatement.
expandedcharacter(len=:)outallocatableStatement after substitution.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

wall_option ​

gnuplot set wall [y0|x0|y1|x1|z0] [fs ...] [fc C] [lw W] ...: the grid walls of a 3D view, polygons over the planes x = 0, y = 0, x = 1, y = 1, z = 0 of the graph, drawn behind or in front of the plot as they face (gnuplot's LAYER_FRONTBACK); half transparent, bordered in black, in gnuplot's colors by default. Bare, y0, x0 and z0 on. Read as a set object polygon of graph corners (its options), kept apart from the objects.

fortran
subroutine wall_option(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inTokens, wall first.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

annotation_option ​

set label [N] ["text"] [at POS] [left|center|right] [norotate|rotate [by A]] [front|back] [tc COLOR] [point [pt N] [ps S] [lc C]|nopoint] [offset X,Y] [font F] [noenhanced], set arrow [N] [from POS to|rto POS] [as|arrowstyle S] [nohead|head|backhead|heads] [size [SYS] L,A[,B]] [filled|empty|nofilled|noborder] [front|back] [lc C] [lt N] [lw W] [dt N] (as S the look of set style arrow S, the options after it applied on it), set style arrow S [default|ARROW OPTIONS], set object [N] rectangle [from POS to|rto POS|center|at POS size W,H] | circle [at|center POS] size R [arc [A:B]] | ellipse [at|center POS] size W,H [angle A] | polygon from POS to POS ... [front|back|behind] [clip|noclip] [fc|fillcolor COLOR] [fs FILL] [lw W] [dt N] [default] (a new rectangle in the style of set style rectangle [fc C] [fs FILL] [lw W] [dt N], its layer not taken, as gnuplot 6.0); set label|arrow|object N ... without a position changes tag N (gnuplot's). A position is [SYS] x, [SYS] y, SYS among first (default), second, graph, screen, character, the system of x also y's unless given; each coordinate an expression, or a time string on a time axis. Not a constant. Constant status.

Style counter.

fortran
subroutine annotation_option(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inOption tokens (the option first).
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

range_value ​

Value of a range end: a number, a constant expression (2*pi, user variables), or a string: a time read with the timefmt (set xrange ["2024-03-01":"2024-03-02"] on a time axis).

fortran
subroutine range_value(self, text, v, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
textcharacter(len=*)inEnd text.
vreal(kind=R8P)outValue.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

set_time_data ​

set xdata|ydata|y2data|x2data [time] (option the option word): the data of that axis read as times with the timefmt (on), or as numbers; the axis ticked and labelled as times or numbers.

fortran
subroutine set_time_data(self, option, on)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
optioncharacter(len=*)inOption word, xdata, y2da, ...
onlogicalinTime data.

Call graph

load_data ​

Load the data file file, or the datablock it names ($DATA), with the set datafile options; skip its first lines not read (gnuplot skip N); content the rows of a pseudo-file ('+') instead.

fortran
subroutine load_data(self, data, file, iostat, iomsg, keep_text, skip, content)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
datatype(datafile_object)inoutData.
filecharacter(len=*)inFile or datablock name.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
keep_textlogicalinoptionalKeep the cell texts.
skipinteger(kind=I4P)inoptionalFirst lines not read.
contentcharacter(len=*)inoptionalRows of a pseudo-file.

Call graph

register_file ​

Remember file among the data files read (once), not a datablock.

fortran
subroutine register_file(self, file)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
filecharacter(len=*)inData file.

Call graph

save_output ​

Render the figure to the current output; the format follows its extension.

fortran
subroutine save_output(self, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

set_command ​

set options. The option without its no.

Size.

The other axes.

Fraction.

Full intensity.

LaTeX code.

Width and height [px].

Line width factor.

Dash length factor.

Color spec. SVG color. A color.

Font string. Size [pt]. Its comma. Read status.

Page font.

Page font.

The add token.

Token. Depth.

Token. Number read.

Bound given. Bounds. Column: 1 u, 2 v.

Box size.

Attributes: recursive

fortran
subroutine set_command(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inOption tokens.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

unset_command ​

unset options. Axis number.

The other axes.

The other axes.

Tag. Token counter.

Tag. Token counter.

Axes named.

Default view.

fortran
subroutine unset_command(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inOption tokens.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

fix_range ​

The range of axis fixed as it is (gnuplot unset autoscale): its set ends, else the effective ones.

Attributes: pure

fortran
subroutine fix_range(axis)

Arguments

NameTypeIntentAttributesDescription
axistype(axis_object)inoutAxis.

Call graph

item_auto_title ​

The automatic title of a data item, gnuplot's: the item as written from its file (characters first to file_last of the statement text) through its data options (index, every, using, matrix, skip: up to last); inline data as '-' or "-"; from the file written in its quote and the using spec when the positions are not the text's (binary items rewritten). A subroutine with its arguments: nvfortran 26.9 broke the data of the plot through an internal function of plot_items returning the title.

Attributes: pure

fortran
subroutine item_auto_title(text, first, file_last, last, written, quote, spec, using, title)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inStatement.
firstinteger(kind=I4P)inFirst character of the file.
file_lastinteger(kind=I4P)inIts last character.
lastinteger(kind=I4P)inLast character of the data options.
writtencharacter(len=*)inThe file as written.
quotecharacter(len=*)inIts quote.
speccharacter(len=*)inThe using spec as written.
usingcharacter(len=*)inThe using keyword as written.
titlecharacter(len=:)outallocatableTitle.

Call graph

smooth_scans3d ​

Each scan of a 3D series smoothed by gnuplot's do_3d_cubic (foresight_smooth's spline_curve3d, mode csplines or acsplines, weights w), samples points each, a break between scans; the per point colors follow.

Attributes: pure

fortran
subroutine smooth_scans3d(series, w, mode, samples, ranges)

Arguments

NameTypeIntentAttributesDescription
seriestype(series_object)inoutSeries.
wreal(kind=R8P)inWeights of the points.
modecharacter(len=*)inSmoothing.
samplesinteger(kind=I4P)inPoints per smoothed scan.
rangesreal(kind=R8P)inAxis lengths.

Call graph

map_points ​

The points of a 3D series read in spherical (mapping 1: theta, phi, r) or cylindrical (2: theta, z, r) coordinates made cartesian, as gnuplot's get_3ddata: x = r cos(theta) cos(phi), y = r sin(theta) cos(phi), z = r sin(phi); x = r cos(theta), y = r sin(theta), z the second. Angles in degrees with degrees.

Attributes: pure

fortran
subroutine map_points(series, mapping, degrees)

Arguments

NameTypeIntentAttributesDescription
seriestype(series_object)inoutSeries.
mappinginteger(kind=I4P)inMapping.
degreeslogicalinAngles in degrees.

set_heights ​

Give series its heights z and its scans (first and last point of each) in their datasets sets, the first grid of them its surface grid, read from data (gnuplot keeps those last first).

Attributes: pure

fortran
subroutine set_heights(series, z, scans, sets, grid, read)

Arguments

NameTypeIntentAttributesDescription
seriestype(series_object)inoutSeries.
zreal(kind=R8P)inHeights.
scansinteger(kind=I4P)inScans.
setsinteger(kind=I4P)inTheir datasets.
gridinteger(kind=I4P)inGrid scans.
readlogicalinRead from data.

append_text ​

Append piece to buffer(1:used), doubling its length as needed: a long text built in linear time.

Attributes: pure

fortran
subroutine append_text(buffer, used, piece)

Arguments

NameTypeIntentAttributesDescription
buffercharacter(len=:)inoutallocatableText, valid up to used.
usedinteger(kind=I4P)inoutIts length used.
piececharacter(len=*)inText appended.

Call graph

using_parts ​

The fields of a using spec as written, split at the colons outside parentheses and quotes (as parse_using).

Attributes: pure

fortran
subroutine using_parts(spec, parts)

Arguments

NameTypeIntentAttributesDescription
speccharacter(len=*)inSpecification.
partscharacter(len=:)outallocatableFields, blank padded.

Call graph

exit_command ​

gnuplot exit, exit message "text" (the text on the standard error), exit error "text", exit status N, exit gnuplot, quit: exit ends the script file being read, as return (signal 3); the others the run (signal 4), exit status N with N its status.

Attributes: recursive

fortran
subroutine exit_command(self, statement, command, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inThe statement.
commandcharacter(len=*)inexit or quit.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

push_local ​

Append item to list, through a temporary (nvfortran 26.9: see foresight_tokens push).

Attributes: pure

fortran
subroutine push_local(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(local_state)inoutallocatableList.
itemtype(local_state)inNew item.

Call graph

inline_items ​

The inline data items '-' of the plot, replot, fit and stats statements of a line: rewritten with each one as its datablock (inline_name), quotes the quote of each (one character per item, empty if none), in order.

Attributes: pure

fortran
subroutine inline_items(line, rewritten, quotes)

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)inLogical line.
rewrittencharacter(len=:)outallocatableLine with the datablock names.
quotescharacter(len=:)outallocatableQuote of each item.

Call graph

inline_statement ​

The inline data items of a plot, replot, fit or stats statement, quotes extended with theirs (see inline_items). An item is '-' or "-" where a file is expected: first, or after a comma, past inline ranges and for [...]; for fit, after a blank.

Attributes: pure

fortran
subroutine inline_statement(line, quotes, rewritten)

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)inStatement.
quotescharacter(len=:)inoutallocatableQuote of each item.
rewrittencharacter(len=:)outallocatableStatement with the datablock names.

Call graph

autoscale_axis ​

axis autoscaled at its ends (min, max), not extended to the ticks with fix (gnuplot set autoscale).

Attributes: pure

fortran
subroutine autoscale_axis(axis, ends, fix)

Arguments

NameTypeIntentAttributesDescription
axistype(axis_object)inoutAxis.
endslogicalinmin, max autoscaled.
fixlogicalinEnds at the data.

split_words ​

The blank-separated words of text (blanks, tabs, new lines), as gnuplot's words() and word().

Attributes: pure

fortran
subroutine split_words(text, words)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
wordstype(token_object)outallocatableWords.

Call graph

split_range ​

a:b[:c] cut at the colons outside parentheses and quotes.

Attributes: pure

fortran
subroutine split_range(text, parts)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inRange.
partscharacter(len=:)outallocatableEnds.

Call graph

array_command ​

gnuplot array NAME[N], array NAME[N] = [E1, E2, ...], array NAME = [E1, ...]: text follows array. Its elements. An array or a slice.

fortran
subroutine array_command(symbols, text, degrees, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
symbolstype(symbols_object)inoutSymbols.
textcharacter(len=*)inText after array.
degreeslogicalinAngles in degrees.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

default_styles ​

gnuplot's default arrow styles (none) and rectangle style (filled with the page color, bordered black).

fortran
subroutine default_styles(self)

Arguments

NameTypeIntentAttributesDescription
selftype(script_object)inoutInterpreter.

Call graph

expand_backquotes ​

gnuplot's command substitution: each `command` outside single quotes replaced by the command's standard output, its trailing newline dropped; in double quotes a backslash escapes the next character (\`, \").

fortran
subroutine expand_backquotes(statement, expanded, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
statementcharacter(len=*)inStatement.
expandedcharacter(len=:)outallocatableStatement substituted.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

split_arguments ​

text cut at the commas outside quotes, parentheses and brackets (print a, sprintf("%d,%d", 1, 2)); no text is no part.

Attributes: pure

fortran
subroutine split_arguments(text, parts)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
partstype(token_object)outallocatableParts, trimmed.

Call graph

regular_grid ​

Gather the points (x, y, z) on a regular grid: the sorted distinct finite abscissae xs and ordinates ys, evenly spaced, and the values grid(i, j) at (xs(i), ys(j)), NaN where no point lies; problem if the points do not lie on such a grid.

Attributes: pure

fortran
subroutine regular_grid(x, y, z, xs, ys, grid, problem)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inAbscissae.
yreal(kind=R8P)inOrdinates.
zreal(kind=R8P)inValues.
xsreal(kind=R8P)outallocatablePixel centre abscissae.
ysreal(kind=R8P)outallocatablePixel centre ordinates.
gridreal(kind=R8P)outallocatableValues.
problemcharacter(len=:)outallocatableProblem, empty if none.

Call graph

resolve_colors ​

Replace each color string of a statement, a string after rgb, lc, fc, tc or background (and their long forms), by its SVG color, as gnuplot reads it (gnuplot_color): "green" is #00ff00, gnuplot's, not SVG's #008000. A string that is no color fails as gnuplot.

Attributes: pure

fortran
subroutine resolve_colors(tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inoutTokens.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

fail ​

Set an error.

Attributes: pure

fortran
subroutine fail(message, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
messagecharacter(len=*)inError message.
iostatinteger(kind=I4P)outSet to 1.
iomsgcharacter(len=:)outallocatableSet to message.

Call graph

parse_using ​

using specification: 1 to 6 colon separated fields, each a column number (0 is the point number) or a parenthesized expression (with the user variables and functions of symbols), as in gnuplot; sampled names the sample variables of a pseudo-file (columns 1 and 2).

fortran
subroutine parse_using(spec, fields, iostat, iomsg, degrees, symbols, sampled)

Arguments

NameTypeIntentAttributesDescription
speccharacter(len=*)inSpecification.
fieldstype(expression_object)outallocatableFields.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinAngles of the expressions in degrees.
symbolstype(symbols_object)inoutUser variables and functions.
sampledcharacter(len=*)inoptionalSample variables of a pseudo-file.

Call graph

apply_line_style ​

Apply the line style id to line: its defined properties; an undefined style is the linetype id, as gnuplot.

Attributes: pure

fortran
subroutine apply_line_style(styles, id, line, colors)

Arguments

NameTypeIntentAttributesDescription
stylestype(line_style_object)inDefined styles.
idinteger(kind=I4P)inStyle number.
linetype(line_style_object)inoutLine properties.
colorscharacter(len=9)inoptionalActive linetype colors (set colorsequence).

Call graph

matrix_every ​

The submatrix of z(column, row) gnuplot's every keeps: the columns as the points (point_incr, start_point, end_point), the rows as the blocks (block_incr, start_block, end_block), from 0; cx, ry their indices.

Attributes: pure

fortran
subroutine matrix_every(z, every, sub, cx, ry)

Arguments

NameTypeIntentAttributesDescription
zreal(kind=R8P)inMatrix.
everyinteger(kind=I4P)inevery fields, ends -1 for none.
subreal(kind=R8P)outallocatableSubmatrix.
cxreal(kind=R8P)outallocatableIts column indices.
ryreal(kind=R8P)outallocatableIts row indices.

Call graph

parse_every ​

gnuplot every point_incr:block_incr:start_point:start_block:end_point:end_block; empty or missing fields keep their defaults (1, 1, 0, 0, no end, no end); with symbols a field may be an expression, every ::j:0:j:0.

fortran
subroutine parse_every(spec, every, iostat, iomsg, symbols)

Arguments

NameTypeIntentAttributesDescription
speccharacter(len=*)inSpecification.
everyinteger(kind=I4P)outFields, ends -1 for none.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
symbolstype(symbols_object)inoptionalUser variables and functions.

Call graph

sharpened ​

gnuplot 6.0's sharpen filter: the samples x, y of func with the truncated extrema added, found by a golden section search between the neighbours of a sample lower (higher) than the two on each side where the 5-term Savitzky-Golay second derivative two samples away is negative (positive), as gnuplot (filters.c).

fortran
subroutine sharpened(func, x, y, sx, sy)

Arguments

NameTypeIntentAttributesDescription
functype(expression_object)inoutFunction.
xreal(kind=R8P)inSample abscissae.
yreal(kind=R8P)inSample values.
sxreal(kind=R8P)outallocatableAbscissae, ascending.
syreal(kind=R8P)outallocatableValues.

Call graph

above_below_base ​

gnuplot's filledcurves above|below without y=V nor a band: above or below y = 0; with an axis (above x1) the words are dropped, the curve filled to the axis (gnuplot 6.0 ignores them there).

fortran
subroutine above_below_base(curve, base, band)

Arguments

NameTypeIntentAttributesDescription
curvecharacter(len=:)inoutallocatableCurve words.
basereal(kind=R8P)inoutallocatableBase line.
bandlogicalinA band x:y1:y2.

Call graph

filled_options ​

The filledcurves options of text (words blank separated, xy=X,Y one word) as a plot item reads them: the curve words (closed, x1, x2, above, below, y1, y2, y, x=V, xy=X,Y) in curve, y=V (y1=, y2=) the base; bad names the problem, empty if none.

fortran
subroutine filled_options(text, curve, base, bad)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inOptions.
curvecharacter(len=:)inoutallocatableCurve words.
basereal(kind=R8P)inoutallocatableBase line.
badcharacter(len=:)outallocatableProblem, empty if none.

Call graph

push_line_style ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_line_style(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(line_style_object)inoutallocatableList.
itemtype(line_style_object)inNew item.

fetch_voxel ​

The active interpreter's active voxel grid at p (foresight_expression's voxel_hook, gnuplot's voxel()): NaN out of its ranges, found false if no grid is active or its ranges are not set yet.

fortran
subroutine fetch_voxel(p, v, found)

Arguments

NameTypeIntentAttributesDescription
preal(kind=R8P)inPoint.
vreal(kind=R8P)outValue.
foundlogicaloutA grid is active.

Call graph

vgrid_ranges ​

The active grid's ranges (gnuplot's check_grid_ranges): those set by set vxrange..., else the fixed x, y, z ranges of the plot now; an error without either. Then its spacing.

fortran
subroutine vgrid_ranges(self, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

voxel_option ​

gnuplot 6.0's set vgrid $name [size N] (a new grid of N x N x N zeros, N 10..256, 100 by default, or the grid of that name kept, made active), set vxrange|vyrange|vzrange [min:max] (of the active grid) and set isosurface [mixed|triangles] [noinsidecolor|insidecolor N]. tokens from the option.

fortran
subroutine voxel_option(self, tokens, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inOption tokens.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

voxel_statement ​

gnuplot 6.0's unset vgrid $name (its storage freed; no grid active if it was), vclear [$name] (its values zeroed, the active grid's by default), voxel(x,y,z) = value (the grid point of (x,y,z): out of the ranges a warning, gnuplot's, nothing set) and vfill/vgfill SOURCE using x:y:z:radius:(density) (voxelgrid.c: the density added to each grid point within the radius of each point, VoxelDistance and GridDistance its distances when the density is evaluated; vgfill's radius in grid units). The vfill rows are read as plot ... with table reads them, every source and option of a plot (sample [t=a:b] '+', datablocks, files, '-').

fortran
subroutine voxel_statement(self, command, tokens, statement, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
commandcharacter(len=*)inCommand word.
tokenstype(token_object)inStatement tokens.
statementcharacter(len=*)inStatement text.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

fill_grid ​

into a datablock), then for each point the grid points within its radius incremented by the density (the fifth field), VoxelDistance and GridDistance set to their distances when it is evaluated (gnuplot's modify_voxels: single precision sums; a point out of the grid's ranges ignored).

fortran
subroutine fill_grid(self, tokens, statement, u, parts, grid_units, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inStatement tokens.
statementcharacter(len=*)inStatement text (the tokens' positions).
uinteger(kind=I4P)inusing token.
partscharacter(len=*)inusing fields.
grid_unitslogicalinvgfill.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

voxel_items ​

The splot items of voxel grids as datablocks (gnuplot 6.0's vplot.c): $grid with points|dots [above L] the grid points above L (0 by default; dots without a style, gnuplot's), x, y, z and the value, colored by it with lc palette; $grid with isosurface level L the facets of the surface of L (marching cubes, set isosurface's mixed quadrangles and triangles or triangles only) as with polygons, in the item's color and the fill style. Each with a hidden item of the grid's corners, which autoscale the axes as gnuplot's grid ranges do.

fortran
subroutine voxel_items(self, tokens, items, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
tokenstype(token_object)inPlot tokens.
itemstype(token_object)outallocatableTokens, grids as datablocks.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

Functions ​

string_expression ​

The string expression starting at token i, as gnuplot takes one wherever a string goes: a quoted string, or an expression of strings, string variables and functions ("run".i.".dat", sprintf("p = %.2f", p), name). On return i is its last token. A number is an error.

Returns: logical

fortran
function string_expression(self, tokens, i, text, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutFirst token in, last token out.
textcharacter(len=:)outallocatableString.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

font_spec ​

The font after the font word at token i (gnuplot font "family:Bold:Italic,size", a string expression), i left on its last token. Compiled-in family. The family is compiled in.

Returns: logical

fortran
function font_spec(self, tokens, i, font, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutThe font word in, the spec's last token out.
fonttype(font_object)outFont.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

string_argument ​

Optional string expression after an option (set title "T", set output name . ".svg"); absent means empty.

Returns: logical

fortran
function string_argument(self, tokens, text, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
tokenstype(token_object)inOption tokens.
textcharacter(len=:)outallocatableString.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

text_color ​

tc|textcolor COLOR with tc at token i, left on the color's last token: lt N (linetype N's color), else as a line color (rgb "red", "#rrggbb", a number); palette colors refused. Linetype.

Returns: logical

fortran
function text_color(self, tokens, i, color, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
tokenstype(token_object)inStatement tokens.
iinteger(kind=I4P)inoutToken counter.
colorcharacter(len=*)inoutColor read.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

names_variable ​

Whether the k-th of the blank separated names is a name in the model text (gnuplot's fit_dummy_var). A module procedure, not fit_command's: an internal one there and nvfortran 26.9 loses the via names (move_alloc).

Attributes: pure

Returns: logical

fortran
function names_variable(model, names, k) result(yes)

Arguments

NameTypeIntentAttributesDescription
modelcharacter(len=*)inFitted expression.
namescharacter(len=*)inVariable names.
kinteger(kind=I4P)inVariable.

Call graph

word_count ​

Number of blank separated words of text.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function word_count(text) result(n)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

first_word ​

The first blank separated word of text.

Attributes: pure

Returns: character(len=:)

fortran
function first_word(text) result(word)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

assignment ​

gnuplot's NAME = expression (a user variable, its value now) or NAME(P1, ...) = expression (a user function): an = right after the name or the parameter list, not ==. False if statement is neither.

Attributes: recursive

Returns: logical

fortran
function assignment(self, statement, iostat, iomsg) result(done)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inoutInterpreter.
statementcharacter(len=*)inStatement.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

is_cntrparam_word ​

Whether word is an option of set cntrparam.

Attributes: pure

Returns: logical

fortran
function is_cntrparam_word(word) result(yes)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.

Call graph

latex_title ​

An automatic title for LaTeX, as gnuplot's texify_title: a function's in math ($...$), a data file's with LaTeX's reserved characters #$%^&_{}\ escaped by a backslash.

Attributes: pure

Returns: character(len=:)

fortran
function latex_title(title, formula) result(text)

Arguments

NameTypeIntentAttributesDescription
titlecharacter(len=*)inTitle.
formulalogicalinA function's.

sector_values ​

Per vertex values of sectors from their rows' (vertex_rows, 0 a separator: NaN).

Attributes: pure

Returns: real(kind=R8P)

fortran
function sector_values(rows_values, vertex_rows) result(values)

Arguments

NameTypeIntentAttributesDescription
rows_valuesreal(kind=R8P)inValue of each data row.
vertex_rowsinteger(kind=I4P)inRow of each vertex.

exact_real ​

v written to its last bit (17 significant digits), read back the same.

Attributes: pure

Returns: character(len=:)

fortran
function exact_real(v) result(text)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inValue.

Call graph

axis_span ​

The length of axis as gnuplot's 3D splines read it while the data come: its set range, else the values' extent (1 for an empty one).

Attributes: pure

Returns: real(kind=R8P)

fortran
function axis_span(axis, values) result(span)

Arguments

NameTypeIntentAttributesDescription
axistype(axis_object)inAxis.
valuesreal(kind=R8P)inValues of the item.

Call graph

replace_colons ​

The fields of a using spec as blank separated words (the count of its fields by word_count).

Attributes: pure

Returns: character(len=:)

fortran
function replace_colons(spec) result(words)

Arguments

NameTypeIntentAttributesDescription
speccharacter(len=*)inSpecification.

Call graph

top_colon ​

Position of the first : outside quotes and parentheses, 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function top_colon(text) result(colon)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

is_datablock ​

Whether word names a datablock: $, then a letter or _, then letters, digits, _ (gnuplot $DATA).

Attributes: pure

Returns: logical

fortran
function is_datablock(word) result(yes)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.

Call graph

string_variable_of ​

Whether name is a string variable of symbols.

Attributes: pure

Returns: logical

fortran
function string_variable_of(symbols, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
symbolstype(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

last_semicolon ​

Position of the last ; of line outside quotes (a statement separator), 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function last_semicolon(line) result(k)

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)inLogical line.

Call graph

heredoc ​

Whether line starts a datablock, $NAME << WORD (blanks optional around <<, a comment after WORD), giving its name ($NAME) and terminator.

Returns: logical

fortran
function heredoc(line, name, terminator) result(yes)

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)inLogical line.
namecharacter(len=:)inoutallocatableDatablock name.
terminatorcharacter(len=:)inoutallocatableTerminating word.

Call graph

for_follows ​

Whether statement, after its command word, goes on with for [.

Attributes: pure

Returns: logical

fortran
function for_follows(statement, command) result(yes)

Arguments

NameTypeIntentAttributesDescription
statementcharacter(len=*)inStatement.
commandcharacter(len=*)inIts first word.

Call graph

leading_word ​

The letters starting text (blanks skipped): do, if, while, else, for, break.

Attributes: pure

Returns: character(len=:)

fortran
function leading_word(text) result(word)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

inline_name ​

The datablock of the n-th inline data item '-' of a line: $FS_INLINE_S<n> quoted by ', $FS_INLINE_D<n> by " (the auto title written back as the item was).

Attributes: pure

Returns: character(len=:)

fortran
function inline_name(quote, n) result(name)

Arguments

NameTypeIntentAttributesDescription
quotecharacter(len=1)inQuote of the item.
ninteger(kind=I4P)inItem order.

Call graph

matching ​

Position of the bracket closing the one at open ((, [ or {), quotes and nesting respected; 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function matching(text, open) result(close)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
openinteger(kind=I4P)inOpening bracket.

Call graph

block_body ​

{ body } rest: the body and the text after the closing brace.

Returns: logical

fortran
function block_body(text, body, rest) result(ok)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText starting with {.
bodycharacter(len=:)outallocatableBody.
restcharacter(len=:)outallocatableAfter the block.

Call graph

old_if ​

Whether statement is gnuplot's old one-line if (condition) command (no block after the condition).

Returns: logical

fortran
function old_if(statement) result(yes)

Arguments

NameTypeIntentAttributesDescription
statementcharacter(len=*)inStatement.

Call graph

same_line_end ​

The last of statements (from s) on the same line of text as statement s.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function same_line_end(text, statements, s) result(e)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText the statements come from.
statementstype(token_object)inStatements, with their places in text.
sinteger(kind=I4P)inFirst statement.

parenthesized ​

( inside ) rest.

Returns: logical

fortran
function parenthesized(text, inside, rest) result(ok)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText starting with (.
insidecharacter(len=:)outallocatableInside the parentheses.
restcharacter(len=:)outallocatableAfter them.

Call graph

mentions ​

Whether the identifier name appears in text (not as part of a longer identifier).

Attributes: pure

Returns: logical

fortran
function mentions(text, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
namecharacter(len=*)inIdentifier.

closing_bracket ​

Position of the ] closing the [ at open in s (quotes and nested brackets skipped), 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function closing_bracket(s, open) result(close)

Arguments

NameTypeIntentAttributesDescription
scharacter(len=*)inText.
openinteger(kind=I4P)inOpening bracket.

Call graph

after_command ​

Text of statement after its first word.

Attributes: pure

Returns: character(len=:)

fortran
function after_command(statement) result(rest)

Arguments

NameTypeIntentAttributesDescription
statementcharacter(len=*)inStatement.

Call graph

axes_argument ​

Optional axes names after a logscale option (default all: xyy2cbx2); a base other than 10 is an error.

Returns: logical

fortran
function axes_argument(tokens, axes, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inOption tokens.
axescharacter(len=:)outallocatableAxes letters.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

style_code ​

Style code of a full style name.

Returns: integer(kind=I4P)

fortran
function style_code(name) result(code)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inFull style name.

Call graph

smooth_name ​

Full name of the smooth filter word, full or abbreviated as gnuplot 6.0 reads it (its plot_smooth_tbl, in order: f frequency, cum cumulative, mcs mcsplines, fnor fnormal, ...); word itself if no filter.

Attributes: pure

Returns: character(len=:)

fortran
function smooth_name(word) result(name)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inFilter word.

Call graph

canonical_style ​

Full gnuplot style name of word (full or abbreviated), empty if unsupported.

Attributes: pure

Returns: character(len=:)

fortran
function canonical_style(word) result(style)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inStyle word.

Call graph

change_extension ​

file with its extension replaced by ext (appended if none).

Attributes: pure

Returns: character(len=:)

fortran
function change_extension(file, ext) result(renamed)

Arguments

NameTypeIntentAttributesDescription
filecharacter(len=*)inFile name.
extcharacter(len=*)inNew extension.

Call graph

extension ​

Lower case extension of file, empty if none.

Attributes: pure

Returns: character(len=:)

fortran
function extension(file) result(ext)

Arguments

NameTypeIntentAttributesDescription
filecharacter(len=*)inFile name.

Call graph

is_multiplot_option ​

Whether the statement is set|unset multiplot ....

Attributes: pure

Returns: logical

fortran
function is_multiplot_option(tokens) result(is)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inStatement tokens.

Call graph

coordinate_system ​

The coordinate system word abbreviates (gnuplot's first,second, graph,screen, char$acter), empty if none.

Attributes: pure

Returns: character(len=:)

fortran
function coordinate_system(word) result(system)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.

Call graph

keyword ​

Whether word abbreviates full with at least minimum characters, as gnuplot keywords.

Attributes: pure

Returns: logical

fortran
function keyword(word, full, minimum) result(match)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.
fullcharacter(len=*)inFull keyword.
minimuminteger(kind=I4P)inShortest accepted abbreviation.

Call graph

is_word ​

Whether word is one of the blank separated words.

Attributes: pure

Returns: logical

fortran
function is_word(word, words) result(found)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.
wordscharacter(len=*)inBlank separated words.

Call graph

next_integer ​

Advance i to the next token, which must be an integer. Value. Not a constant. Constant status.

Returns: logical

fortran
function next_integer(tokens, i, value, iostat, iomsg, symbols) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutToken counter.
valueinteger(kind=I4P)outInteger.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
symbolstype(symbols_object)inoptionalUser variables: a constant expression too.

Call graph

clip_words ​

gnuplot set clip (on) and unset clip words after the option: points, one, two, radial (polar: accepted, foresight clips at the plot area); bare set clip is points, bare unset clip all of them.

Returns: logical

fortran
function clip_words(panel, tokens, on, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
paneltype(axes_object)inoutPanel.
tokenstype(token_object)inOption tokens.
onlogicalinset, else unset.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

next_real ​

Advance i to the next token, which must be a number. Not a constant. Constant status.

Returns: logical

fortran
function next_real(tokens, i, value, iostat, iomsg, symbols) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutToken counter.
valuereal(kind=R8P)outNumber.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
symbolstype(symbols_object)inoptionalUser variables: a constant expression too.

Call graph

next_length ​

Advance i to the next token, a length of gnuplot's cairo terminals: a number in inches, or followed by its unit (8.5cm, 3in, 240pt, the unit joined or the next token), as pixels (96 to the inch).

Returns: logical

fortran
function next_length(tokens, i, px, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutToken counter.
pxreal(kind=R8P)outLength [px].
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

next_word ​

Advance i to the next token, which must be a bare word.

Returns: logical

fortran
function next_word(tokens, i, word, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutToken counter.
wordcharacter(len=:)outallocatableToken text.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

no_more ​

Error if tokens exist from position from on (unsupported sub-options).

Returns: logical

fortran
function no_more(tokens, from, iostat, iomsg) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
frominteger(kind=I4P)inFirst position that must be empty.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

columnhead_title ​

Parse columnhead, columnheader or columnhead(N) (gnuplot title columnhead): column is N, or 0 for the column of the y field; false if word is none of them.

Returns: logical

fortran
function columnhead_title(word, column) result(ok)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inTitle word.
columninteger(kind=I4P)outHeader column, 0 for the y one.

Call graph

function_drawable ​

Whether the style with draws a function (FUNCTION_STYLES): not error bars, nor the filled and panel styles.

Attributes: pure

Returns: logical

fortran
function function_drawable(with) result(yes)

Arguments

NameTypeIntentAttributesDescription
withcharacter(len=*)inFull style name.

Call graph

colormap_index ​

Index of the colormap name (set colormap new NAME), 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function colormap_index(self, name) result(k)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
namecharacter(len=*)inColormap name.

Call graph

plain_data_format ​

Whether the data format of a using spec is blank separated numeric scanf conversions (%lf %lf): the default reading (a skipped column, %*lf, is not).

Attributes: pure

Returns: logical

fortran
function plain_data_format(format) result(plain)

Arguments

NameTypeIntentAttributesDescription
formatcharacter(len=*)inFormat.

Call graph

binary_type_name ​

gnuplot's name of the binary field type word (its aliases of show datafile binary datasizes: f float, lf double, d and i int, byte int8, ...), a leading * (a skipped field) kept.

Attributes: pure

Returns: character(len=:)

fortran
function binary_type_name(word) result(name)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inType as written, without its %.

Call graph

findloc_name ​

Index of name among names, 0 if absent (a loop: nvfortran 26.9 refuses findloc on some arrays). names is not allocatable: with a character(len=*), allocatable array dummy here, nvfortran 26.9 -O2 miscompiled the internal procedures of annotation_option (set label|arrow|object positions read wrong, bug 24).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function findloc_name(names, name) result(k)

Arguments

NameTypeIntentAttributesDescription
namescharacter(len=*)inNames.
namecharacter(len=*)inName.

Call graph

in_wedge ​

Whether the angle t [deg] lies in the wedge from tmin to tmax [deg] (gnuplot's in_theta_wedge).

Attributes: pure

Returns: logical

fortran
function in_wedge(t, tmin, tmax) result(inside)

Arguments

NameTypeIntentAttributesDescription
treal(kind=R8P)inAngle.
tminreal(kind=R8P)inWedge start.
tmaxreal(kind=R8P)inWedge end.

is_item_option ​

Whether word is a plot item option: it ends a function expression.

Attributes: pure

Returns: logical

fortran
function is_item_option(word) result(is)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inWord.

Call graph

is_line_option ​

Whether word names a line property: lc, lt, lw, dt, ps, pt or their long forms.

Attributes: pure

Returns: logical

fortran
function is_line_option(word) result(is)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inOption word.

Call graph

special_color ​

SVG color of gnuplot's special linetypes: black, nodraw (nothing drawn), bgnd (the background, white).

Attributes: pure

Returns: character(len=:)

fortran
function special_color(word) result(color)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inSpecial name.

Call graph

argb_color ​

The SVG color of gnuplot's number 0xAARRGGBB: #rrggbb, or #rrggbbaa with the opacity 255 - AA (AA the transparency, 0 opaque).

Attributes: pure

Returns: character(len=:)

fortran
function argb_color(v) result(color)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inColor number.

Call graph

line_option ​

Parse the line property at tokens(i) and its value into line, leaving i on the value's last token: lc [rgb] "color", lc N, lc [rgb] variable (the color column marker), lc palette [z|cb V|frac F] (markers, the value in line%palette), lt N (linetype color N), lw W, dt N, ps S, pt N. Color number.

Custom pattern. Not a string. String status. A string.

Returns: logical

fortran
function line_option(tokens, i, line, iostat, iomsg, colors, symbols) result(ok)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
iinteger(kind=I4P)inoutToken counter.
linetype(line_style_object)inoutLine properties.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
colorscharacter(len=9)inoptionalActive linetype colors (set colorsequence).
symbolstype(symbols_object)inoptionalUser variables: lc i, lw w.

Call graph

plain_columns ​

using fields of plain columns.

Attributes: pure

Returns: type(expression_object)

fortran
function plain_columns(columns) result(fields)

Arguments

NameTypeIntentAttributesDescription
columnsinteger(kind=I4P)inColumns.

Call graph

sum_head ​

Whether token ends with gnuplot's sum, its range next: sum [i=1:n] term, 2*sum [i=1:n] term.

Attributes: pure

Returns: logical

fortran
function sum_head(token) result(yes)

Arguments

NameTypeIntentAttributesDescription
tokentype(token_object)inToken.

Call graph

expression_end ​

Last token of the expression starting at token first: tokens join where an operator lies between them (a word ending or starting with one of .+-*/%?:<>=!&|, or eq, ne), and a range glued to its left neighbour is a substring, s[1:2]: "run".i.".dat", 'f' . i, sprintf("%d", n).

Returns: integer(kind=I4P)

fortran
function expression_end(tokens, first) result(last)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.
firstinteger(kind=I4P)inFirst token.

Call graph

expression_source ​

Expression text of tokens: quoted strings quoted again (escapes restored in double quotes), ranges bracketed.

Attributes: pure

Returns: character(len=:)

fortran
function expression_source(tokens) result(source)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inTokens.

Call graph

valid_axes ​

Whether names concatenates supported axis names: x, y, y2, cb, x2.

Attributes: pure

Returns: logical

fortran
function valid_axes(names) result(ok)

Arguments

NameTypeIntentAttributesDescription
namescharacter(len=*)inAxis names.

Call graph

read_whole ​

The whole content of file, ok false if it cannot be read.

Returns: logical

fortran
function read_whole(file, text) result(ok)

Arguments

NameTypeIntentAttributesDescription
filecharacter(len=*)inFile name.
textcharacter(len=:)outallocatableContent.

to_number ​

Parse a number; false if malformed or beyond the real range.

Returns: logical

fortran
function to_number(word, value) result(ok)

Arguments

NameTypeIntentAttributesDescription
wordcharacter(len=*)inText.
valuereal(kind=R8P)outNumber.

Call graph

vgrid_index ​

The voxel grid named name ($grid), 0 if none.

Returns: integer(kind=I4P)

fortran
function vgrid_index(self, name) result(k)

Arguments

NameTypeIntentAttributesDescription
selfclass(script_object)inInterpreter.
namecharacter(len=*)inName.

Call graph

split_top ​

text split at the separator characters outside parentheses, brackets and quotes.

Attributes: pure

Returns: character(len=:)

fortran
function split_top(text, separator) result(parts)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
separatorcharacter(len=1)inSeparator.

Call graph

voxel_word ​

Whether a set/unset names a voxel option: vgrid, vxrange, vyrange, vzrange, isosurface.

Attributes: pure

Returns: logical

fortran
function voxel_word(tokens) result(yes)

Arguments

NameTypeIntentAttributesDescription
tokenstype(token_object)inStatement tokens.

Call graph

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.