Credits | Overview | Plotting Styles | Commands | Terminals |
---|
The smooth acsplines option approximates the data with a natural smoothing spline. After the data are made monotonic in x (see smooth unique), a curve is piecewise constructed from segments of cubic polynomials whose coefficients are found by fitting to the individual data points weighted by the value, if any, given in the third column of the using spec. The default is equivalent to
plot 'data-file' using 1:2:(1.0) smooth acsplines
Qualitatively, the absolute magnitude of the weights determines the number of segments used to construct the curve. If the weights are large, the effect of each datum is large and the curve approaches that produced by connecting consecutive points with natural cubic splines. If the weights are small, the curve is composed of fewer segments and thus is smoother; the limiting case is the single segment produced by a weighted linear least squares fit to all the data. The smoothing weight can be expressed in terms of errors as a statistical weight for a point divided by a "smoothing factor" for the curve so that (standard) errors in the file can be used as smoothing weights.
Example:
sw(x,S)=1/(x*x*S) plot 'data_file' using 1:2:(sw($3,100)) smooth acsplines splot 'data_file' using 1:2:3:(sw($4,100)) smooth acsplines
splot ... smooth acsplines with lines fits splines to the x, y, and z coordinates of successive data points. Unlike the 2D case, the points are not sorted first so it is possible to fit splines to a trajectory containing loops. Caution: In the general 3D case there are many more spline terms fitted, so the weight value must be larger to achieve a comparable effect. Also note that fractional path length is used as the implicit control variable and therefore the intervals being weighted do not match the projections onto a single axis.