Fit & Plot: read the fitted curve

Comparing observations and model visually is an essential part of fitting. The plot lets you spot deviations, check the axes, zoom into details and tell a Preview from an accepted curve.

Reference interface: GX-TXT DEV112-P011 · Dataset Curve Fit.

What Fit & Plot shows

The Fit & Plot tab holds the Cartesian representation of the data and of the curves generated by Curve Fitter. The position of the points depends on the variables selected in the Dataset; the model is drawn in the same coordinate system, allowing an immediate comparison.

In our example we use the synthetic Dataset c15_curved_signal, made of 13 pairs of values: time from 0 to 12 s on the X axis and voltage in volts on the Y axis. The voltage rises with a slightly curved trend.

Open Viewers → Curve Fitter, choose the Dataset, select X = Time (s) and Y = Voltage (V), then press Add Dataset curve. Leave Model = linear, Fit orientation = Y = f(X), Fit points = all and Output domain = source.

Figure 1. The original source is shown in blue. The curvature of the signal is already visible from how the slope between consecutive points changes.

Compare the observations and the preview

Press Preview fit. The plot shows the model estimate as a dashed green line. The blue curve instead represents the original observations, which are not replaced by the Preview.

Figure 2. The linear Preview passes through the central region of the data but does not reproduce the curvature. The deviations have a recognizable pattern.

The line fitted to the thirteen observations is:

U(t) ≈ ( 0.227390 V/s) · t + 0.115659 V.

The result is RMSE = 0.174106 V and R² = 0.959808. An R² close to 1 can suggest overall agreement, but it is not enough to show that the mathematical form is adequate: here the linear model leaves a systematic deviation from the curve of the points.

For Y=f(X), the residual of each observation is the difference between the measured voltage and the voltage predicted at the same time coordinate:

rᵢ = Uᵢ − Ufit(tᵢ).

In the plot these differences correspond to vertical deviations, not to the shortest distance between a point and the line. In an inverse or geometric regression the meaning of the residual can change.

Interpreting axes and intervals

Always read the axis labels before interpreting a curve: in the example X is time in seconds and Y is the voltage in volts. The same graphic form can represent completely different phenomena when the units change.

The ticks and limits displayed belong to the view of the plot, not to the data domain. For example, if the X axis shows values slightly below zero, this does not necessarily mean that the Dataset contains observations at negative time: the window may include a margin around the points.

You also need to distinguish physical changes in the data from changes of scale. A peak can look narrower or a slope steeper when the visual ratio between the axis ranges changes, without any change in the numerical values.

Zoom into a region with the scroll wheel

Place the pointer inside the plotting area and use the mouse wheel. Scrolling up zooms into the region of interest; scrolling the other way zooms out. View → Zoom in and View → Zoom out commands are also available.

Figure 3. Zoom changes the visible portion of the plane. It does not change the Dataset, the estimated parameters or the number of observations used in the fit.

To return to the overall view choose View → Fit view. The command recomputes the framing of the source and the result. It is useful after many zoom steps, but it is not the same as running Preview fit again.

If you use the wheel over the side control panel, the interface may scroll that panel instead. To zoom the plot, place the cursor on the canvas.

Plot grid, axes, and background

The Samples and presentation panel contains the Grid / background / aspect… button, which opens the Construction grid / view window. This window provides settings for grid visibility, origin axes, major and minor lines, colors and background.

Figure 4. The presentation options let you adjust grid, lines and background, separately from the model calculation.

A grid can help you read coordinates and compare regions of the plot; too many lines can make it less clear. For scientific figures a discreet grid is often preferable, with clearly readable axis labels and a sharp distinction between original data and fitted curve.

From a Preview plot to an accepted curve

When the fit is satisfactory, press Accept fit and assign a name to the result. In the example we use C15 Linear Approximation. The curve is added to the Results and publication → Accepted fits list.

Figure 5. The accepted result has its own name and entry in the panel. The original curve remains available and separate from the fit.

The accepted curve is a Workspace object and keeps its link to the model and the source. Its name lets you recognize it when the Session contains several fits or several Datasets.

Show and hide a fit without deleting it

Select the result in the Accepted fits list and use Show / Hide. The fitted line can be hidden temporarily while the original curve stays visible. The command is reversible: select the same item again and press Show / Hide, and the curve reappears.

Figure 6. The fit is hidden, not deleted: the name stays in the list and the original data are still displayed.

Do not confuse Show / Hide with Delete fit. The first affects only visibility; the second removes the accepted result. If you want to compare two curves, temporarily hiding one is often more useful than deleting it.

When the graph shows an inadequate model

Comparing curves is particularly informative when the deviations show a recognizable trend. In our example the line crosses the central region of the series but does not follow the overall curvature. This suggests trying a quadratic function or a more appropriate physical law, rather than merely minimizing the RMSE.

The visual indications must then be confirmed with the Residuals tab, checking the sign, size and distribution of the residuals, and with Parameters & Statistics, to assess coefficients and indicators. A convincing fit must be consistent both with the points and with the scientific problem you want to represent.

The final choice does not depend only on how the plot looks: the domain in which the model is valid, the parameter units, the uncertainties of the observations and the ability to describe new data not used in the fit all matter.