Plotting a Graph and the Best-Fit Line
A question to start
The spring table from the last lesson has seven rows of numbers. Does the extension grow steadily with the load, or does it speed up? Is any reading odd? Staring at the numbers, it's hard to say. On a graph (đồ thị) you see the answer at a glance.
The idea: a good graph, step by step
- Axes. The independent variable goes across (-axis), the dependent variable up (-axis).
- Labels. Each axis gets the quantity and unit, written like a table heading: "load / N", "extension / cm".
- Scales. Choose an easy step per large square, 1, 2 or 5 (times a power of ten), never 3 or 7. The points should fill more than half of the grid in both directions. The scale must be even: equal distances for equal steps. The axes don't have to start at zero unless you need the intercept.
- Points. Plot each point carefully as a small cross () or a dot in a small circle, so you can still see exactly where it is.
- Best-fit line. If the points look like a straight line, draw one straight line with a ruler that passes as close as possible to all of them, with points scattered evenly above and below it. If the trend is curved, draw one smooth curve. Never join the dots.
- Anomalies. A point far from the line is not forced into it: circle it, check it, and leave it out of the line if it is a mistake.
Why a best-fit line?
Every point has a random error, so the points scatter a little around the true relationship. The best-fit line averages the scatter, just as the mean averages repeated readings. Joining the dots would copy every random error into the graph and hide the real pattern.
Drawing it by eye. Place a transparent ruler so that about as many points lie above it as below, and their distances balance. A useful trick: calculate the mean point and make the line pass through it. The least-squares line that calculators and spreadsheets work out always goes through the mean point, and it makes the sum of the squared vertical distances from the points, , as small as possible.
Worked example: the spring graph
Given: the spring data (load to , extension to ). Find: sensible scales, and what the best-fit line shows. Solve:
- -axis: to , per large square (6 squares).
- -axis: to , per large square (8 squares). A step of would make plotting awkward, so is better.
- The mean point is , .
- The points lie close to a straight line through the origin and through .
Answer: extension is directly proportional to load: a straight line through the origin, as Hooke's law says. Check: no point is far from the line, so there is no anomaly.
Reading values off the graph. For a load of , go up from on the -axis to the line and across: about . Reading between measured points (interpolation) is reliable. Reading beyond them (extrapolation, for example at ) is risky: the spring could stop obeying the straight line, or be damaged.
Try it in the simulation
Here is a similar spring experiment with six points and their error bars. The dotted line is your line: it always passes through the mean point, and the slider Gradient of your line turns it. Make ("your ") as small as you can, then press Play to see the least-squares line and compare. Use the Data set slider for new data.
With data set 1 the least-squares gradient is and its is ; no other straight line does better.
Try it: your own graph
Use your helicopter, pendulum or bouncing-ball data, or the pendulum table from the last lesson. Plot it on graph paper (or in a spreadsheet, then check the scales and labels yourself). Ask a friend to check your graph against the six steps above.
Common mistakes
- Joining the dots, or drawing a wobbly freehand "line".
- An uneven scale, such as at equal spacing.
- Awkward scale steps (3 or 7 per square), which make plotting slow and error-prone.
- A tiny graph in one corner of the paper.
- Forcing the line through the origin, or through the first and last points, when the data don't go there.
- Big blobs for points, which hide where the point really is.
Practice
- Readings of go from to ; the graph paper has 10 large squares up. Which scale per large square is best: , or ?
Answer
per square: covers and uses most of the grid. is an awkward step, and would squeeze the points into the bottom half.
- Four points lie on a smooth curve and one point is far above it. A student draws a line that bends up to reach that point. What should he have done?
Answer
Draw the smooth curve through the other points, circle the odd point as an anomaly, check or repeat that measurement, and say in the report why it was left out.
- Find the mean point of , , , .
Answer
, : the mean point is , and a best-fit line should pass through it.
Test yourself
How should a best-fit line be drawn through points that lie roughly in a straight line?
- Join each point to the next
- One straight line with points evenly scattered on both sides
- Through the first and last points only
- Always through the origin
Which scale step per large square is a good choice?
- 3 units
- 7 units
- 2 units
- it doesn't matter
Reading a value from the graph between two measured points is called ...
- extrapolation
- interpolation
- linearising
- calibration
Which point does the least-squares line always pass through?
- The origin
- The first point
- The mean point
- The highest point