Graphical analysis is the primary tool for extracting physical relationships from data.
Plotting conventions
- Independent variable on the -axis, dependent on the -axis.
- Label axes with quantity, symbol, and units: e.g. "Force (N)".
- Include error bars showing measurement uncertainty.
Linearisation — Many physical laws become linear with the right transformation:
| Law | Plot | Slope |
|---|---|---|
| vs | ||
| vs | ||
| vs | ||
| vs |
Least-squares fit — For , minimise:
Reduced chi-squared — where is the number of fit parameters. A good fit gives .
import numpy as np
x = np.array([1, 2, 3, 4, 5])
y = np.array([2.1, 3.9, 6.2, 7.8, 10.1])
m, c = np.polyfit(x, y, 1)
print(f"Slope = {m:.2f}, Intercept = {c:.2f}")
Key insight: If your data doesn't linearise as expected, the assumed model may be wrong. The graph tells you this before any statistical test does.
Common pitfall: Fitting a curve to data proves little by itself — enough parameters fit anything. Linearize so theory predicts a straight line, then let the residuals judge: structure in the residuals means the model, not the data, is wrong.
Least-Squares Regression
A best-fit line minimises the sum of squared residuals:
Setting and yields slope and intercept.
The correlation coefficient quantifies fit quality (1 = perfect, 0 = none).
A poor fit may indicate systematic errors or an incorrect theoretical model.