Skip to content

foresight_smooth ​

foresight_smooth, gnuplot smooth filters of a data series.

The filters gnuplot computes from the data alone, without a fit: each run of placeable points (a block of the data file, broken by undefined points and by points not placeable on a log axis) is sorted by x, stably, and its points of equal x are merged into one:

  • unique: the mean of their y;
  • frequency: the sum of their y; fnormal divided by the sum of y over every run;
  • cumulative: the sum of y up to that x within the run; cnormal divided by the sum of y over every run.

Runs stay separate, joined by an undefined (NaN) point that breaks the line, as gnuplot draws them.

Source: src/lib/foresight_smooth.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
SMOOTH_MODEScharacter(len=*)parameterSupported filters.

Subroutines ​

smooth ​

Filter the series (x, y) with the smooth mode (one of SMOOTH_MODES) into (xs, ys); xlog, ylog tell the log axes, on which non-positive values are not placeable.

fortran
subroutine smooth(mode, x, y, xlog, ylog, xs, ys)

Arguments

NameTypeIntentAttributesDescription
modecharacter(len=*)inFilter.
xreal(kind=R8P)inAbscissae.
yreal(kind=R8P)inOrdinates.
xloglogicalinLog x axis.
yloglogicalinLog y axis.
xsreal(kind=R8P)outallocatableFiltered abscissae.
ysreal(kind=R8P)outallocatableFiltered ordinates.

Call graph

Functions ​

placeable ​

Whether v is placeable on an axis: finite, and positive on a log axis (as foresight_axis%accepts).

Attributes: elemental

Returns: logical

fortran
function placeable(v, log) result(ok)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inValue.
loglogicalinLog axis.

Call graph

sorted ​

Permutation sorting keys ascending, stable (equal keys keep their order): bottom-up merge sort.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function sorted(keys) result(order)

Arguments

NameTypeIntentAttributesDescription
keysreal(kind=R8P)inKeys, no NaN.

Call graph