Mathematics » Introducing Graphs » Graphing Linear Equations

Graphing a Linear Equation by Plotting Points

Graphing a Linear Equation by Plotting Points

There are several methods that can be used to graph a linear equation. The method we used at the start of this section to graph is called plotting points, or the Point-Plotting Method.

Let’s graph the equation \(y=2x+1\) by plotting points.

We start by finding three points that are solutions to the equation. We can choose any value for \(x\) or \(y,\) and then solve for the other variable.

Since \(y\) is isolated on the left side of the equation, it is easier to choose values for \(x.\) We will use \(0,1,\) and \(-2\) for \(x\) for this example. We substitute each value of \(x\) into the equation and solve for \(y.\)

The figure shows three algebraic substitutions into an equation. The first substitution is for x = -2, with -2 shown in blue. The next line is y = 2 x + 1. The next line is y = 2 open parentheses -2, shown in blue, closed parentheses, + 1. The next line is y = - 4 + 1. The next line is y = -3. The last line is “ordered pair -2, -3”. The second  substitution is for x = 0, with 0 shown in blue. The next line is y = 2 x + 1. The next line is y = 2 open parentheses 0, shown in blue, closed parentheses, + 1. The next line is y = 0 + 1. The next line is y = 1. The last line is “ordered pair 0, 2”. The third substitution is for x = 1, with 1 shown in blue. The next line is y = 2 x + 1. The next line is y = 2 open parentheses 1, shown in blue, closed parentheses, + 1. The next line is y = 2 + 1. The next line is y = 3. The last line is “ordered pair -1, 3”.

We can organize the solutions in a table. See the table below.

\(y=2x+1\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(1\)\(\left(0,1\right)\)
\(1\)\(3\)\(\left(1,3\right)\)
\(-2\)\(-3\)\(\left(-2,-3\right)\)

Now we plot the points on a rectangular coordinate system. Check that the points line up. If they did not line up, it would mean we made a mistake and should double-check all our work. See the figure below.

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. Three labeled points are shown, “ordered pair -2, -3”, “ordered pair 0, 1”, and ordered pair 1, 3”.

Draw the line through the three points. Extend the line to fill the grid and put arrows on both ends of the line. The line is the graph of \(y=2x+1.\)

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair -2, -3”, “ordered pair 0, 1”, and ordered pair 1, 3”.

How to Graph a linear equation by plotting points.

  1. Find three points whose coordinates are solutions to the equation. Organize them in a table.
  2. Plot the points on a rectangular coordinate system. Check that the points line up. If they do not, carefully check your work.
  3. Draw the line through the points. Extend the line to fill the grid and put arrows on both ends of the line.

It is true that it only takes two points to determine a line, but it is a good habit to use three points. If you plot only two points and one of them is incorrect, you can still draw a line but it will not represent the solutions to the equation. It will be the wrong line. If you use three points, and one is incorrect, the points will not line up. This tells you something is wrong and you need to check your work. See the figure below.

There are two figures. Figure a shows three points that are all contained on a straight line. There is a line with arrows that passed through the three points. Figure b shows 3 points that are not all arranged in a straight line.

Look at the difference between (a) and (b). All three points in (a) line up so we can draw one line through them. The three points in (b) do not line up. We cannot draw a single straight line through all three points.

Example

Graph the equation \(y=-3x.\)

Solution

Find three points that are solutions to the equation. It’s easier to choose values for \(x,\) and solve for \(y.\) Do you see why?

The figure shows three algebraic substitutions into an equation. The first substitution is for x = 0, with 0 shown in blue. The next line is y = -3 x. The next line is y = -3 open parentheses 0, shown in blue, closed parentheses. The next line is y = 0. The last line is “ordered pair 0, 0 “. The second substitution is for x = 1, with 0 shown in blue. The next line is y = -3 x. The next line is y = -3 open parentheses 1, shown in blue, closed parentheses. The next line is y = -3. The last line is “ordered pair 1, -3”. The third substitution is for x = -2, with -2 shown in blue. The next line is y = -3 x. The next line is y = -3 open parentheses -2, shown in blue, closed parentheses. The next line is y = 6. The last line is “ordered pair -2, 6 “.

List the points in a table.

\(y=-3x\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(0\)\(\left(0,0\right)\)
\(1\)\(3\)\(\left(1,-3\right)\)
\(-2\)\(6\)\(\left(-2,6\right)\)

Plot the points, check that they line up, and draw the line as shown.

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair -2, 6”, “ordered pair 0, 0”, and ordered pair 1, -3”. The line is labeled y = -3 x.

When an equation includes a fraction as the coefficient of \(x,\) we can substitute any numbers for \(x.\) But the math is easier if we make ‘good’ choices for the values of \(x.\) This way we will avoid fraction answers, which are hard to graph precisely.

Example

Graph the equation \(y=\frac{1}{2}x+3.\)

Solution

Find three points that are solutions to the equation. Since this equation has the fraction \(\frac{1}{2}\) as a coefficient of \(x,\) we will choose values of \(x\) carefully. We will use zero as one choice and multiples of \(2\) for the other choices.

The figure shows three algebraic substitutions into an equation. The first substitution is for x = 0, with 0 shown in blue. The next line is y = 1 over 2 x + 3. The next line is y = 1 over 2 open parentheses 0, shown in blue, closed parentheses, + 3.  The next line is y = 3. The last line is “ordered pair 0, 3”. The second substitution is for x = 2, with 2 shown in blue. The next line is y = 1 over 2 x + 3. The next line is y = 1 over 2 open parentheses 2, shown in blue, closed parentheses, + 3.  The next line is y = 4. The last line is “ordered pair 2, 4”. The third substitution is for x = 4, with 4 shown in blue. The next line is y = 1 over 2 x + 3. The next line is y = 1 over 2 open parentheses 4, shown in blue, closed parentheses, + 3.  The next line is y = 5. The last line is “ordered pair 4, 5”.

The points are shown in the table.

\(y=\frac{1}{2}x+3\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(3\)\(\left(0,3\right)\)
\(2\)\(4\)\(\left(2,4\right)\)
\(4\)\(5\)\(\left(4,5\right)\)

Plot the points, check that they line up, and draw the line as shown.

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair 0, 3”, “ordered pair 2, 4”, and ordered pair 4, 5”. The line is labeled y = 1 over 2 x + 3.

So far, all the equations we graphed had \(y\) given in terms of \(x.\) Now we’ll graph an equation with \(x\) and \(y\) on the same side.

Example

Graph the equation \(x+y=5.\)

Solution

Find three points that are solutions to the equation. Remember, you can start with any value of \(x\) or \(y.\)

The figure shows three algebraic substitutions into an equation. The first substitution is for x = 0, with 0 shown in blue. The next line is x + y = 5. The next line is 0, shown in blue + y = 5. The next line is y = 5. The last line is “ordered pair 0, 5”. The second substitution is for x = 1, with 1 shown in blue. The next line is x + y = 5. The next line is 1, shown in blue + y = 5. The next line is y = 4. The last line is “ordered pair 1, 4”. The third substitution is for x = 4, with 4 shown in blue. The next line is x + y = 5. The next line is 4, shown in blue + y = 5. The next line is y = 1. The last line is “ordered pair 4, 1”.

We list the points in a table.

\(x+y=5\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(5\)\(\left(0,5\right)\)
\(1\)\(4\)\(\left(1,4\right)\)
\(4\)\(1\)\(\left(4,1\right)\)

Then plot the points, check that they line up, and draw the line.

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair 0, 5”, “ordered pair 1, 4”, and ordered pair 4, 1”. The line is labeled x + y = 5.

In the previous example, the three points we found were easy to graph. But this is not always the case. Let’s see what happens in the equation \(2x+y=3.\) If \(y\) is \(0,\) what is the value of \(x?\)

This figure shows an algebraic substitution. The first line is 2 x + y = 3. The second line is 2 x + 0, with 0 shown in red. The third line is 2 x = 3. The last line is x = 3 over 2.

The solution is the point \(\left(\frac{3}{2},0\right).\) This point has a fraction for the \(x\)-coordinate. While we could graph this point, it is hard to be precise graphing fractions. Remember in the example \(y=\frac{1}{2}x+3,\) we carefully chose values for \(x\) so as not to graph fractions at all. If we solve the equation \(2x+y=3\) for \(y,\) it will be easier to find three solutions to the equation.

\(2x+y=3\)

\(y=-2x+3\)

Now we can choose values for \(x\) that will give coordinates that are integers. The solutions for \(x=0,x=1,\) and \(x=-1\) are shown.

\(y=-2x+3\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(5\)\(\left(-1,5\right)\)
\(1\)\(3\)\(\left(0,3\right)\)
\(-1\)\(1\)\(\left(1,1\right)\)

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair -1, 5”, “ordered pair 0, 3”, and ordered pair 1, 1”. The line is labeled 2 x + y = 3.

Example

Graph the equation \(3x+y=-1.\)

Solution

Find three points that are solutions to the equation.

First, solve the equation for \(y.\)

\(\begin{array}{rcl}3x+y & = & −1 \\ y & = & −3x−1\end{array}\)

We’ll let \(x\) be \(0,1,\) and \(-1\) to find three points. The ordered pairs are shown in the table. Plot the points, check that they line up, and draw the line.

\(y=-3x-1\)
\(x\)\(y\)\(\left(x,y\right)\)
\(0\)\(-1\)\(\left(0,-1\right)\)
\(1\)\(-4\)\(\left(1,-4\right)\)
\(-1\)\(2\)\(\left(-1,2\right)\)

The graph shows the x y-coordinate plane. The x and y-axis each run from -7 to 7. A line passes through three labeled points, “ordered pair -1, 2”, “ordered pair 0, -1”, and ordered pair 1, -4”. The line is labeled 3 x + y = -1.

If you can choose any three points to graph a line, how will you know if your graph matches the one shown in the answers in the book? If the points where the graphs cross the \(x\text{-}\) and \(y\)-axes are the same, the graphs match.

[Attributions and Licenses]


This is a lesson from the tutorial, Introducing Graphs and you are encouraged to log in or register, so that you can track your progress.

Log In

Share Thoughts