Two Lines
Show a second dataset or a model function on the same axes, and switch between them with the line selector.
CFTool can plot a second line on the same axes. You can either plot a second dataset and fit it independently, or plot just a function (no second dataset) evaluated on the X values of the first dataset, using the Fitting Coefficients table as absolute values. This is useful for comparisons — measured vs measured, or measured vs model — without juggling multiple figures. You can find the points of intersection between the two lines using Find Intersections in the main graph right click context menu. A second line can only be added after a first dataset has been loaded.
01Choosing which line you work on
CFTool works on one line at a time, chosen with the Line Selector drop-down:
- Primary Line — your first dataset and its fit.
- Secondary Line — the second dataset and its own fit. It appears as Function Line when Function Mode is on.
- Full Graph — both lines shown together. This is a view: line-specific controls (fit type, limits, single-line label editing) are locked here — switch back to Primary Line or Secondary Line to change that line.
Whichever line is selected is the one the fit-controls, limits and Label Editor act on.
Editing a line’s labels. To edit the primary line’s labels while a second line exists, just select Primary Line.
02Option A — second dataset + independent fit
- Load or enter your first dataset as usual (Edit ▸ Edit Data), and save it.
- Select Secondary Line from the line selector to work on the second line.
- Add its data: open Edit ▸ Edit Data and enter/paste the second dataset, or open a data file with File ▸ Load Data. Ensure both datasets have X and Y (including σX and σY where relevant). Save it under a different filename.
- Choose a fit type for the second line (it can differ from the first), or enter a custom function.
- Use Fitting Coefficients to set starting values / bounds, then press Run Fit.
What gets plotted in Full Graph mode: the primary dataset and its fitted curve, plus the second dataset (markers) and its own fitted curve. Legends, colours and markers follow your current style settings; adjust them in Plot Settings and the Label Editor.
03Option B — function only (no second dataset)
Use Function Mode to overlay a pure function (model) on your first dataset without loading a second dataset.
- CFTool evaluates your chosen function over the X range of the first dataset.
- The second line’s Fitting Coefficients are treated as absolute values, not shared with the first line.
- This lets you sketch predictions, compare parameter sets, or show a theoretical curve alongside measured data.
Steps:
- With your first dataset loaded, press Function Mode — the second line’s slot now reads Function Line.
- Select a built-in function or enter a custom function for the second line.
- Press Fitting Coefficients and supply the absolute coefficient values.
- Press Run Fit to draw the function over the first line’s X range.
No fit for a function line. There is no Y data to minimise against, so a function line is a computed curve from the coefficients you set — not a fit.
Function Mode as a fit test-bed. Once a function line is drawn, you can hand its function and coefficients to the primary line as the starting point for a real fit: right-click the second line’s fit-info (results) box and choose Copy fit to Line 1. CFTool copies the function, coefficients and bounds across as starting values (not a finished fit), so you can shape a model visually in Function Mode and then fit it properly to your data with Run Fit.
04Expressions & coefficients
- CFTool uses the same expression engine as fitting: sin, cos, tan, exp, log, sqrt, abs, and standard arithmetic.
- Use x for the horizontal-axis variable.
- Coefficient names must match those in your expression (e.g. a, b, c).
05Error bars, statistics & residuals
Data + fit (Option A): any σ columns supplied for the second line are used normally — to enable error bars, select the second line and turn them on as usual (similarly for the primary line). Fit statistics, parameter errors and residuals are available for the second line just like the first; toggle between them with the tabs below the statistics pane.
Function only (Option B): no errors or residuals apply (there is no second Y dataset), and the primary line’s residuals continue to show. The curve is drawn from the expression and coefficients only.
06Workflow suggestions
- Measured vs measured: load your reference dataset as the second line, fit it with a different model, and compare parameters.
- Measured vs theory: use Function Mode to plot a theoretical prediction against your experimental data.
- Parameter exploration: keep Function Mode on, tweak the second line’s coefficients, and watch the predicted curve update.
07Tips
- Axes & scaling: both lines share the same axes. Each line’s fit can be limited to its data or extended beyond it with the Fit to Data / Extend Fit button — now set per line, so you can extend the primary fit while keeping the secondary one tight. Set it while viewing that line; in Full Graph the button is disabled (it would hit both), and the graph shows each line in its own mode.
- Legend clarity: rename line labels in the Label Editor so the legend clearly distinguishes data and function.
- Shared vs independent parameters: the second line’s parameters do not affect the primary fit. In Function Mode they are absolute values; in data + fit they are initial guesses and bounds for the second line’s own fit.
- Exporting figures: use the Print tool; both lines and legends are included in PNG / JPG / TIFF / PDF / SVG output.
- Saving projects: in project mode, both line configurations — data sources, expressions, coefficients and modes — are saved with the .cfp project.