Websink Prep UKGCSE MathsTextbook contentsMaths textbooksYear 1Year 2Year 4Year 5Year 6GCSEBrowse allPast papersFind a tutorBecome a tutor
GCSE Maths · EdexcelChapter 12 · Straight-line graphs and coordinates
GCSE Maths · Straight-Line Graphs and Coordinates · Foundation · Lesson 12.3

GCSE Maths: Horizontal and vertical lines, and drawing graphs from tables (Foundation)

Part of the GCSE Maths straight-line graphs and coordinates chapter (Foundation). Chapter overview · Higher version of this lesson · whole chapter on one page · Download worksheet (PDF) · Answers (PDF)

Download worksheet (PDF)Answers (PDF)
12.3

Horizontal and vertical lines, and drawing graphs from tables

Edexcel 1MA1: A9
Grade 2-4

An equation of a line is a rule that every point on the line obeys. Plot the points (3, −2), (3, 0) and (3, 4). They all have x = 3, and they line up straight up and down. The rule “x is always 3” is written x = 3, and it is the equation of a vertical line that passes through 3 on the x-axis. In the same way y = −2 is a horizontal line passing through −2 on the y-axis, because every point on it has y = −2.

Two special lines are the axes themselves. The y-axis is the line x = 0 and the x-axis is the line y = 0.

xy−6−5−4−3−2−1123456−4−3−2−112345Ox = 3y = −2x = −4y = 2
Vertical lines are x = a number. Horizontal lines are y = a number.

Drawing a line from its equation

Most lines are neither flat nor upright. A line such as y = 2x + 1 is a rule that tells you what y is for any x: double the x, then add 1. To draw it:

  1. Make a table of values. Choose some x values (three or four, including negatives and 0) and work out y for each.
  2. Plot the points (x, y) on a grid.
  3. Join them with a ruler to make a straight line, and extend it across the grid. Add the equation as a label.

Why does this give a straight line? Because x appears only on its own (not as x² or 1/x), so each time x goes up by 1, y always goes up by the same amount. Equations like this are called linear. You only need two points to draw a straight line, but plot at least three: if they do not line up, you have made a mistake in your working.

When you substitute a negative number, put it in brackets: if x = −2 in y = 2x + 1 write 2 × (−2) + 1 = −4 + 1 = −3. A point is on the line if its coordinates make the equation true. For example (3, 7) is on y = 2x + 1 because 2 × 3 + 1 = 7, but (3, 8) is not.

xy−3−2−11234−4−3−2−112345678Oy = 2x + 1
The graph of y = 2x + 1 drawn from the table of values x = −2, 0, 1, 3.

Tip: choose x values that give whole-number y values. If the equation has a fraction such as y = ½x + 1, choose even values of x (such as −2, 0, 2, 4) so that the halves disappear.

Key ideas

  • x = a is a vertical line; y = b is a horizontal line. The axes are y = 0 (the x-axis) and x = 0 (the y-axis).
  • To draw a line: table of values → plot the points → ruler → label.
  • Substitute negatives with brackets: 2 × (−3) = −6.
  • A point is on a line only if its coordinates make the equation true.
  • Check that all your points line up: if one does not, recheck its y value.
Worked example 12.3.1
Write down the equation of the vertical line labelled A in the diagram.
xy−6−5−4−3−2−1123456−5−4−3−2−112345OABCD

Key words. A line is horizontal if it is flat, like the horizon, and vertical if it goes straight up and down. The equation of a line is a rule that every point on the line obeys.

Method. A vertical (up and down) line has one coordinate that never changes. The equation says what that coordinate is.

  1. Pick three points on the line. Choose points where the line crosses the grid lines so they are easy to read.
    (2, −2), (2, 1), (2, 3)
  2. Look for the coordinate that does not change. Every point on a vertical line is directly above or below the others, so they share the same x-coordinate.
    The x-coordinate is 2 every time. The y-coordinate changes.
  3. Write the equation. The equation says what is true for every point on the line: x is always 2.
    x = 2

Check. It crosses the x-axis at (2, 0). ✓

Watch out. Vertical lines have equations x = a number; horizontal lines have equations y = a number. Test one point: (3, 0) is on x = 3 but not on y = 3.

Worked example 12.3.2
Draw the graph of y = 2x − 1 for values of x from −2 to 3.

Key words. The equation y = mx + c describes a straight line. m is the gradient (steepness) and c is the y-intercept (the value of y where the line crosses the y-axis, which is where x = 0).

Method. Draw a table of values, plot the points, then join them with a straight line.

  1. Make a table of values. Two points are enough to draw a straight line, but three or more let you spot a mistake: all the points must line up.
  2. Work out y for each x. Substitute each x into the equation.
    x = −2:  y = 2 × (−2) − 1 = −4 − 1 = −5
    x = −1:  y = 2 × (−1) − 1 = −2 − 1 = −3
    x = 0:  y = 2 × 0 − 1 = 0 − 1 = −1
    x = 1:  y = 2 × 1 − 1 = 2 − 1 = 1
    x = 2:  y = 2 × 2 − 1 = 4 − 1 = 3
    x = 3:  y = 2 × 3 − 1 = 6 − 1 = 5
    x−2−10123
    y−5−3−1135
  3. Plot the points. Each pair is a coordinate: across first, then up or down.
    (−2, −5)   (−1, −3)   (0, −1)   (1, 1)   (2, 3)   (3, 5)
  4. Join them with a ruler and extend the line. The graph of a linear equation is a straight line, so the points must line up. If one is out of line, check its working.
    xy−3−2−11234−6−5−4−3−2−1123456Oy = 2x − 1

Check. All the plotted points lie on one straight line. A point taken from the line, such as one with a different x, also satisfies the equation. ✓

Watch out. Use a ruler and extend the line across the whole grid. If the points do not line up, one y value is wrong.

Worked example 12.3.3
Draw the graph of y = −x + 3 for values of x from −2 to 4. (Use x = −2, 0, 2, 4.)

Key words. The equation y = mx + c describes a straight line. m is the gradient (steepness) and c is the y-intercept (the value of y where the line crosses the y-axis, which is where x = 0).

Method. Draw a table of values, plot the points, then join them with a straight line.

  1. Make a table of values. Two points are enough to draw a straight line, but three or more let you spot a mistake: all the points must line up.
  2. Work out y for each x. Substitute each x into the equation.
    x = −2:  y = −(−2) + 3 = 2 + 3 = 5
    x = 0:  y = −0 + 3 = 0 + 3 = 3
    x = 2:  y = −2 + 3 = −2 + 3 = 1
    x = 4:  y = −4 + 3 = −4 + 3 = −1
    x−2024
    y531−1
  3. Plot the points. Each pair is a coordinate: across first, then up or down.
    (−2, 5)   (0, 3)   (2, 1)   (4, −1)
  4. Join them with a ruler and extend the line. The graph of a linear equation is a straight line, so the points must line up. If one is out of line, check its working.
    xy−3−2−112345−2−1123456Oy = −x + 3

Check. All the plotted points lie on one straight line. A point taken from the line, such as one with a different x, also satisfies the equation. ✓

Watch out. Use a ruler and extend the line across the whole grid. If the points do not line up, one y value is wrong.

Worked example 12.3.4
Is the point (4, 10) on the line y = 3x − 2?

Key words. The equation y = mx + c describes a straight line. m is the gradient (steepness) and c is the y-intercept (the value of y where the line crosses the y-axis, which is where x = 0).

Method. A point is on a line if its coordinates make the equation true. Substitute them in.

  1. Substitute the x-coordinate into the equation. If the point is on the line, the equation gives its y-coordinate.
    y = 3 × 4 − 2 = 10
  2. Compare with the y-coordinate of the point. The point is (4, 10), so its y-coordinate is 10.
    10 = 10
  3. Write the conclusion. The point is on the line only if the two values are equal.
    (4, 10) is on the line y = 3x − 2.

Check. Try the substitution the other way: put the y-coordinate in and see if you get the x-coordinate. ✓

Watch out. Put the x in the x place and the y in the y place.

Watch out

Vertical or horizontal? x = 3 is vertical (it goes through 3 on the x-axis) and y = 3 is horizontal. If you are unsure, plot (3, 0) and (0, 3) and see which one is on the line. Also: when x is negative, put it in brackets before you multiply, or you may lose the minus sign.

Exercise 12D  Horizontal and vertical lines, tables of values and drawing lines

Non-calculator
1
FWrite down the equation of each of the lines A, B, C and D.
xy−6−5−4−3−2−1123456−5−4−3−2−112345OABCD
(a)line A
(b)line B
(c)line C
(d)line D
2
FWrite down the equation of each line.
(a)The line is vertical and passes through (−2, 4).
(b)The line is horizontal and passes through (3, 5).
(c)The line is the x-axis.
(d)The line is the y-axis.
3
FComplete the table of values for each equation.
(a)y = x + 1 for x = 0, 1, 2, 3, 4
(b)y = 2x for x = −2, −1, 0, 1, 2
(c)y = 3x − 1 for x = −1, 0, 1, 2, 3
(d)y = −2x + 10 for x = 0, 1, 2, 3, 4
4
F(a) Complete a table of values for y = 2x + 1 for x = −2, −1, 0, 1, 2, 3. (b) Draw the graph of y = 2x + 1.
5
FDraw the graph of y = x − 2 for values of x from −3 to 4.
6
FDraw the graph of y = 3 − x for values of x from −2 to 4.
7
FDraw the graph of y = 3x − 2 for values of x from −1 to 3.
8
FDraw the graph of y = ½x + 2 for values of x from −4 to 4. (Use even values of x.)
9
F(a) Draw the graph of y = x on a grid from −3 to 3. (b) Write down the coordinates of three points on the line. (c) What do you notice about the coordinates of every point on this line?
10
FIs each point on the line y = 2x − 3? Write yes or no and show your working.
(a)(4, 5)
(b)(−1, −5)
(c)(0, 3)
(d)(3, 2)
11
PSA line has equation y = 3x + 2. (a) Find the value of y when x = 4. (b) Find the value of x when y = 11.
12
PSThe points (0, −1), (1, 1) and (2, 3) are on a straight line. Which equation is the equation of the line? A: y = x − 1   B: y = 2x − 1   C: y = 2x + 1
13
RSam says the line y = 3 is a vertical line. Is he right? Give a reason.
14
PSThe lines x = −2, x = 3, y = −1 and y = 3 form a rectangle. Work out its perimeter and its area.
15
RHere is a table of values for a straight line.
x0123
y14711
One of the y values is wrong. Which one, and what should it be? Write the equation of the line.

Websink Prep UK is an independent site. It is not affiliated with, endorsed by or sponsored by AQA, Pearson Edexcel, OCR, WJEC, Eduqas, CCEA, SQA, GL Assessment, CEM or the Department for Education. All exam board names and trademarks belong to their owners. Past papers are linked from the exam boards' own websites and are not hosted here.

About Websink Prep UK · Find a tutor · Privacy · Terms · Cookie settings