# Drawing a Line of Best Fit Through Points Plotted on a Graph Chemistry Tutorial

## Key Concepts

• Experimental data points rarely fit perfectly on a straight line or a smooth curve due to experimental errors.
• A line of best fit, or a curve of best fit, is drawn through these points to allow us to make predictions.
• The line of best fit will be drawn so that it:

(i) passes through, or is as close to, as many points as possible

(ii) has as many points above the line as there are below it

• You can draw an approximate line of best fit through data points just by looking at it (the eyeball method).
• A line of best fit can also be calculated
(you may not be expected to do this in High School, so we have included a tool for members that you can use to draw the line of best fit for your experimental data)(1)

No ads = no money for us = no free stuff for you!

## Eyeball Method for Determine the Line of Best Fit Through Points Plotted on a Graph

Imagine an experiment in which you take different masses of magnesium, ignite each magnesium sample in a closed vessel containing excess oxygen, then weigh the product of each reaction (the magnesium oxide).(2)

The results of the experiment might look like those in the table below. The data in the table has also been plotted as a scatter graph below.

 mass of magnesium (g) mass of magnesium oxide (g) Table of Results 0.99 1.71 2.04 3.15 3.06 5.12 3.80 7.03 4.70 8.04
 mass of magnesium oxide (g) Scatter Graph mass of magnesium (g)

Just by looking at the points on the scatter graph we can see that the general pattern of the points is a straight line. We are confident that we could draw a straight line through these points which could then be used to describe the relationship between the mass of magnesium oxide produced during combustion and the mass of magnesium used in the experiment, and, to predict results of similar experiments.

Let's draw some different lines through the data and then compare them as shown below:

 mass MgO (g) Join-The-Dotsmass Mg (g) Drawing lines between each pair of points is not a line of best fit. We cannot reliably extend this "line" for Mg masses less than 0.99 g or greater than 4.70 g because we can't predict whether the "line" will go up or down next.
 mass MgO (g) Arbitrary Linemass Mg (g) This arbitrary line is not too bad. We can see that the first two points lie below the line, the third point is on the line, and the final two points lie above the line. But, the points below and above the line are a little further away from the line than they could be. This is not a line of best fit.
 mass MgO (g) Line of Best Fitmass Mg (g) This is the line of best fit. There are 2 points above the line (first and fourth points), 2 points below the line (second and fifth points), and 1 point on the line. Notice that the points above and below the line are all very close to the line. Compare the arbitrary line graph on the left with this line graph, this line is a much better fit for the points!

The line of best fit through a set of data points is a line which:

• passes through, or is as close to, as many points as possible
(ignoring points which are clearly different to the general pattern of points)
• has as many points above the line as there are below it

The more data points you have, the more reliable the line of best fit becomes.
If you only have 2 points to plot on the graph, there is only 1 line that you can draw through the points so a Chemist would not think of this line as a line of best fit because it is the only possible line.
If you have 3 points that look like a straight line, then you can find a line of best fit since not all the points might lie exactly on the line.

Do you know this?

Play the game now!

## Line of Best Fit by Calculation

You only need to know the position of 2 points in order to draw a straight line.
You can use the tool below to calculate the position of the first and last points on the line of best for a set of data points, then you can draw a line through those two points which will be the line of best fit.

First, you will need to remember from your Mathematics lessons that a point on a line is represented by a set of coordinates, x and y, written as (x,y).

Step 1: Enter your values for the x-coordinate and y-coordinate for each data point in the textboxes in the table shown on the right.

You MUST enter a minimum of 3 data points.

If you have less than 12 data points, just leave the x and y textboxes for the excess data points blank.

x y
(x1,y1)
(x2,y2)
(x3,y3)
(x4,y4)
(x5,y5)
(x6,y6)
(x7,y7)
(x8,y8)
(x9,y9)
(x10,y11)
(x11,y11)
(x12,y12)
Step 2: Click the Find Points button: Find Points

The two points you need to plot in order to draw the line of best fit are:

First point:

Second point:

A graph of your data with the line of best fit shown is given below:

Do you understand this?

Take the test now!

Footnotes:

(1) There are computer programs and apps that you can use to draw a line of best fit for you.
You may be expected to use Microsoft Excel to do this. You will find instructions on how to this on our blog: Microsoft Excel to Find Line of best Fit
BUT it is important that you understand what a line of best fit is, and what its limitations are, so you should be capable of drawing it yourself on graph paper.

(2) You will probably perform this experiment, or one just like it, in order to experimentally determine the empirical formula of a compound (see Empirical Formula of Magnesium Oxide by Experiment for details).