Plotting Straight-Line Graphs

On this page

How to plot and read coordinates, make a table of values from an equation, draw a straight-line graph with a ruler, draw horizontal and vertical lines, and read values and crossing points from a graph.

Coordinates and straight-line graphs

A straight-line graph shows all the points that fit a rule such as y=2x+1. To draw one, you work out a few points, plot them on a grid and join them with a ruler.

In the exam you are usually asked to draw the graph of a line such as y=3x+1 for values of x from -2 to 2, for 3 marks. Sometimes there is a table of values to complete first; sometimes there is no table and you make your own. Shorter questions ask you to plot a point, draw a line such as y=-1, or read a value from a graph, for 1 mark each.

A coordinate pair (x,y) gives a position on a grid. The axes cross at the origin, O, which is the point (0,0).

The first number tells you how far to go across from the origin: right if it is positive, left if it is negative. The second number tells you how far to go up or down: up if it is positive, down if it is negative. Always go across first.

Worked example 1: Plotting and reading points

Plot the point A(-2,3). Then write down the coordinates of point B on the same grid.

  1. Start at the origin. The first number is -2, so go 2 squares to the left.
  2. The second number is 3, so go 3 squares up and mark a small cross. That is A.
  3. Your turn. Write down the coordinates of B.

    Write your answer as (x, y)

    B is 3 squares right and 1 square down, so B is (3,-1)

  4. Answer: A is plotted at (-2,3) and B is (3,-1)

Horizontal and vertical lines

Every point on the line y=-2 has a y-coordinate of -2, for example (-1,-2), (0,-2) and (4,-2). Joined up, these points make a horizontal line, going straight across.

Every point on the line x=3 has an x-coordinate of 3, for example (3,-1), (3,0) and (3,2). These points make a vertical line, going straight up and down.

So an equation y= a number gives a horizontal line, and an equation x= a number gives a vertical line. The x-axis itself is the line y=0, and the y-axis is the line x=0.

Worked example 2: Drawing horizontal and vertical lines

On one grid, draw the lines y=-2 and x=3. Write down the coordinates of the point where they meet.

  1. For y=-2, every point is 2 squares below the x-axis. Draw a horizontal line through (0,-2)
  2. For x=3, every point is 3 squares to the right of the y-axis. Draw a vertical line through (3,0)
  3. Your turn. Write down the coordinates of the point where the two lines meet.

    Write your answer as (x, y)

    The point is on both lines, so x=3 and y=-2. It is (3,-2)

  4. Answer: the lines meet at (3,-2)

From an equation to a table of values

An equation such as y=2x+1 is a rule: take a value of x, multiply it by 2, then add 1. The result is the matching value of y. Putting a number in place of a letter is called substituting.

Write the x-values along the top row of a table of values, and work out each y-value underneath. Each column then gives one point (x,y) to plot.

When x is negative, put it in a bracket. For x=-3: y=2\times(-3)+1=-6+1=-5

The words "for values of x from -2 to 2" mean use x=-2, -1, 0, 1 and 2. The first and last values are where your line starts and stops. They are not a coordinate pair.

If the equation is written like x+y=6, the two coordinates of every point add up to 6. Rewrite it as y=6-x, then make the table in the usual way.

Worked example 3: Drawing a line from a table of values

Make a table of values for y=2x+1, and draw its graph for values of x from -2 to 2.

  1. Use x=-2, -1, 0, 1 and 2. For x=-2: y=2\times(-2)+1=-4+1=-3
  2. Your turn. Work out y when x=-1.

    y=2\times(-1)+1=-2+1=-1

  3. In the same way, x=0, 1 and 2 give y=1, 3 and 5
  4. Plot the five points (-2,-3), (-1,-1), (0,1), (1,3) and (2,5) with small crosses. They lie in a straight row.
  5. Answer: join the points with one ruled straight line from (-2,-3) to (2,5)

Check that your points line up

In the table for y=2x+1, each time x goes up by 1, y goes up by 2. Equal steps in x give equal steps in y, so the points sit in a straight row.

If one point is out of line, work it out again before you draw. Here 2\times1+1=3, so the point should be (1,3), not (1,4). Never bend the line to reach a wrong point.

To test whether a point is on a line, substitute its x-value. For (3,8) and y=2x+1: 2\times3+1=7, not 8, so (3,8) is not on the line.

Reading values from a graph

To find y for a given value of x, start at that value on the x-axis. Go straight up or down to the line, then straight across to the y-axis and read the value.

To find x for a given value of y, do it the other way round: start on the y-axis, go across to the line, then up or down to the x-axis.

Check the scale on each axis before you count squares. The two axes can have different scales, so one square does not always mean 1.

Worked example 4: Reading a graph with different scales

The graph shows the line y=x+2. Use the graph to find y when x=3, and x when y=0.

  1. Check the scales: on the x-axis each square is 1, but on the y-axis each square is 2.
  2. Go up from x=3 to the line, then across to the y-axis. You arrive halfway between 4 and 6, so y=5
  3. Check with the equation: 3+2=5
  4. Your turn. When y=0, the line is on the x-axis. What is the value of x there?

    The line crosses the x-axis at (-2,0), so x=-2

  5. Answer: y=5 when x=3, and x=-2 when y=0

Worked example 5: Finding where two lines cross

The lines y=x-1 and y=8-2x are drawn on the grid. Write down the coordinates of the point where they cross.

  1. Find the crossing point. From it, go straight down to the x-axis and straight across to the y-axis.
  2. Your turn. Write down the coordinates of the crossing point.

    Write your answer as (x, y)

    The crossing is above x=3 and level with y=2, so it is (3,2)

  3. Check in both equations with x=3: 3-1=2 and 8-2\times3=2
  4. The crossing point fits both equations. So if a question asks you to use the graphs to solve the two equations, the answer is the crossing point's x and y.
  5. Answer: (3,2)

A method for any straight-line graph

  • Table: write down the x-values from the question, including both ends, and work out each y-value. Put negative values of x in brackets.
  • Plot: check the scale on each axis, then mark each point (x,y) with a small cross.
  • Check: the points should lie in a straight row. If one does not, work it out again.
  • Join: draw one straight line with a ruler, from the first point to the last.

Make your own table even when the question doesn't give you one. The examiners say that students who do this nearly always get full marks.

Worked example 6: Drawing a line with no table given

On a grid, draw the graph of y=5-2x for values of x from -1 to 3.

  1. There is no table, so make one with x=-1, 0, 1, 2 and 3.
  2. Your turn. Work out y when x=-1.

    y=5-2\times(-1)=5+2=7

  3. Then x=0, 1, 2 and 3 give y=5, 3, 1 and -1
  4. Check: each time x goes up by 1, y goes down by 2. So the line goes down from left to right.
  5. Answer: plot the five points and draw one ruled line from (-1,7) to (3,-1)

Common mistakes

  • Swapping the coordinates. In (x,y) the first number goes across and the second goes up or down.
  • Getting y wrong when x is negative. Put the negative value in a bracket, so 2\times(-3)+1 is -5.
  • Plotting the points but not joining them. Draw the line with a ruler, from the first value of x to the last.
  • Bending the line to reach a wrong point. A rule like y=2x+1 always gives a straight line, so work out any point that is out of line again.
  • Reading "from -2 to 4" as a point. These are the first and last values of x, not the point (-2,4).
  • Mixing up horizontal and vertical lines. The line y=-4 goes straight across, and the line x=-4 goes straight up and down.

Practice questions