Lines & Graphs

How to Graph a Line Using a Table of Values

To graph a line from a table of values, choose at least three xx-values, substitute each into the equation to find yy, plot the pairs (x,y)(x, y), and draw a straight line through them. For y=mx+by = mx + b, every row of the table is a point that sits on the line.

y=mx+by = mx + b

Try it with your numbers

Show every step

The method works for any linear equation, and it is the one to trust when you cannot yet see the slope at a glance. The sections below cover the steps, how to pick xx-values that make the arithmetic painless, what to do with standard form, and how to catch mistakes before they reach the graph.

How do you graph a line using a table of values?

Build the table, convert each row into a point, and connect the points. Here is the full process:

  1. If the equation is not solved for yy, solve for yy first.
  2. Choose three or more xx-values, including 00.
  3. Substitute each xx into the equation and compute yy.
  4. Write each row as an ordered pair (x,y)(x, y) and plot it.
  5. Lay a ruler through the points, draw the line, and extend it to the edges of the grid with an arrow on each end.

Take y=2x−3y = 2x - 3 with x=−1,0,1,2x = -1, 0, 1, 2. Substituting one value at a time:

y=2(−1)−3=−5,y=2(0)−3=−3,y=2(1)−3=−1,y=2(2)−3=1y = 2(-1) - 3 = -5, \quad y = 2(0) - 3 = -3, \quad y = 2(1) - 3 = -1, \quad y = 2(2) - 3 = 1

The points are (−1,−5)(-1, -5), (0,−3)(0, -3), (1,−1)(1, -1) and (2,1)(2, 1). If you need a refresher on reading and placing coordinates, plotting points on the coordinate plane covers it. The line should climb steadily from lower left to upper right, crossing the yy-axis at −3-3.

Two points are enough to fix a line, so the third and fourth points are not extra work. They are your error detector, and the rest of this page leans on that idea.

Why does a table of values produce a straight line?

A linear equation has a constant rate of change. In y=mx+by = mx + b, raising xx by 11 always raises yy by exactly mm, no matter where you start. So if your xx-values are evenly spaced, your yy-values must also be evenly spaced, and evenly spaced points sit on a line.

You can see this in the example above. The xx-values went up by 11 each row and the yy-values went up by 22 each row, which is the slope of y=2x−3y = 2x - 3. In general, if xx steps by hh, then yy steps by mhmh. That is the same idea behind the slope formula:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

This also explains the role of bb. When x=0x = 0, the equation collapses to y=by = b, so the row for x=0x = 0 hands you the yy-intercept for free. Once you recognize that pattern, the table becomes a slow version of reading slope-intercept form, and the constant step in the yy-column is the average rate of change of the function.

Quick check

A line has slope 33 and passes through (0,−4)(0, -4). Without using an equation, find yy when x=1,2,3x = 1, 2, 3.

How do you choose the best x-values for the table?

Start with x=0x = 0, then go equally far on both sides. Using negatives matters more than it seems: a line plotted only from positive xx-values hides its behavior on the left, and you will not see which of the four quadrants it passes through.

The real skill is choosing xx-values that cancel fractions. Consider y=23x+1y = \frac{2}{3}x + 1. If you pick x=1x = 1, you get y=53y = \frac{5}{3}, which is awkward to plot. Pick multiples of 33 instead:

x=−3:  y=23(−3)+1=−1x=0:  y=1x=3:  y=23(3)+1=3x = -3: \; y = \frac{2}{3}(-3) + 1 = -1 \qquad x = 0: \; y = 1 \qquad x = 3: \; y = \frac{2}{3}(3) + 1 = 3

The points (−3,−1)(-3, -1), (0,1)(0, 1) and (3,3)(3, 3) all land on grid crossings, and the pattern of “right 33, up 22” is visible between them.

Match the denominator

If the slope is ab\frac{a}{b}, choose xx-values that are multiples of bb. Every yy will then be a whole number when bb divides evenly into your xx.

Do not try to force the xx-intercept into the table. For y=23x+1y = \frac{2}{3}x + 1 it sits at x=−32x = -\frac{3}{2}, which is not a pleasant number. You can still find the x and y intercepts separately if a problem asks, but a graph does not need them to be accurate.

Spread the points far apart. Points 11 unit apart magnify tiny plotting slips into a visibly tilted line, while points 66 units apart average them out.

How do you make a table when the equation is in standard form?

Solve for yy first. Take 3x+2y=63x + 2y = 6:

2y=6−3x⇒y=3−32x2y = 6 - 3x \quad \Rightarrow \quad y = 3 - \frac{3}{2}x

The common slip is dividing only some terms by 22. Whatever you divide by, every term on that side gets divided, including the constant.

Since the slope is −32-\frac{3}{2}, choose even xx-values: −2,0,2-2, 0, 2. Then y=3−32(−2)=6y = 3 - \frac{3}{2}(-2) = 6, y=3y = 3, and y=3−32(2)=0y = 3 - \frac{3}{2}(2) = 0. The points are (−2,6)(-2, 6), (0,3)(0, 3) and (2,0)(2, 0). Test one in the original equation: 3(−2)+2(6)=−6+12=63(-2) + 2(6) = -6 + 12 = 6, which works.

A shortcut exists. You do not have to rearrange at all: substitute an xx into the original and solve the small equation. For x=2x = 2, 6+2y=66 + 2y = 6 gives y=0y = 0 immediately. Notice that the rows with x=0x = 0 and y=0y = 0 are the intercepts, which is why graphing lines using x and y intercepts is really a two-row table. Learning standard form of a line well makes this faster, because the intercepts are CA\frac{C}{A} and CB\frac{C}{B} in Ax+By=CAx + By = C.

Try this: Graph x+3y=6x + 3y = 6 using x=−3,0,3x = -3, 0, 3. You should get y=3,2,1y = 3, 2, 1. Check that moving right 33 always moves you down 11.

What does the table look like for horizontal and vertical lines?

Horizontal lines are easy: in y=4y = 4, every xx gives y=4y = 4. A table with x=−2,0,3x = -2, 0, 3 reads 4,4,44, 4, 4 in the yy column, and the slope is 00.

Vertical lines break the usual routine. In x=−2x = -2 there is no yy to solve for, because xx is −2-2 in every row and yy can be anything. The table has to run the other way: choose y=−1,0,2y = -1, 0, 2 and record the points (−2,−1)(-2, -1), (−2,0)(-2, 0), (−2,2)(-2, 2). This is also why a vertical line is not a function and has an undefined slope.

The trap that costs the most points is mixing them up. A quick rule: the line crosses the axis of the variable that appears. So y=4y = 4 crosses the yy-axis at 44 and runs sideways, and x=−2x = -2 crosses the xx-axis at −2-2 and runs up and down. More on both cases is in horizontal and vertical lines.

Quick check

A table lists the points (3,−2)(3, -2), (3,0)(3, 0), (3,5)(3, 5). What is the equation of the line?

How can you tell if a table of values is linear?

Table with x-values 0, 2, 3, 7 showing uneven y-differences but constant ratio of 2
The y-differences 4, 2, 8 look random, but each divided by its x-step equals 2, so the table is linear.

Compare ΔyΔx\frac{\Delta y}{\Delta x} between neighboring rows. Do not compare raw differences in yy unless the xx-values are evenly spaced.

xx 00 22 33 77
yy 11 55 77 1515

The yy-differences are 4,2,84, 2, 8, which look irregular. The ratios tell the truth:

5−12−0=2,7−53−2=2,15−77−3=2\frac{5 - 1}{2 - 0} = 2, \qquad \frac{7 - 5}{3 - 2} = 2, \qquad \frac{15 - 7}{7 - 3} = 2

Every ratio is 22, so the table is linear with slope 22. The row x=0x = 0 gives y=1y = 1, so the equation is y=2x+1y = 2x + 1. Check the last row: 2(7)+1=152(7) + 1 = 15.

If no row has x=0x = 0, pick any two rows and use the method in the equation of a line through two points. Now compare x=−2,1,4x = -2, 1, 4 with y=5,2,0y = 5, 2, 0. The ratios are −1-1 and −23-\frac{2}{3}, so the points are not on one line. One more special case: if the line passes through the origin, so yx\frac{y}{x} is the same in every row, you have direct variation.

How do you check a line you graphed from a table?

Use the redundancy built into the method. Any of these catches an error:

  • The third point lines up with the first two.
  • A plotted point, put back into the original equation, makes it true.
  • The rise over the run between two points on your drawn line matches the slope in the equation.
  • The yy-intercept on your graph matches bb.

Most errors come from negative xx-values. For y=−2x+1y = -2x + 1 at x=−3x = -3, the correct work is −2(−3)+1=6+1=7-2(-3) + 1 = 6 + 1 = 7. Students often write −6+1=−5-6 + 1 = -5, because the two negatives never met. On a calculator, always type the negative xx inside parentheses.

Sign check

If the slope is negative, yy must fall as xx rises. If your table shows yy rising, a sign went wrong in at least one row.

To test a single point, substitute both coordinates. Is (4,−3)(4, -3) on y=−x+1y = -x + 1? Since −4+1=−3-4 + 1 = -3, yes. A point on the line makes the equation true, and a point off the line does not.

Quick check

A student graphs y=−2x+1y = -2x + 1 and gets (−1,−1)(-1, -1), (0,1)(0, 1), (1,3)(1, 3). Which two points are wrong, and what are the correct ones?

Where does graphing from a table of values show up in real life?

Any situation with a flat fee plus a steady rate is a line. A ride costs a 33 booking fee plus 22 per mile, so C=2m+3C = 2m + 3. The table for m=0,1,2,3m = 0, 1, 2, 3 gives costs 3,5,7,93, 5, 7, 9. The slope 22 is the price per mile and the intercept 33 is the fee.

Real-life graphs need a sensible domain. A negative number of miles is meaningless, so the graph starts at (0,3)(0, 3) and runs in one direction, with an arrow on the right end only. If the fare only changes at whole miles, plot separate dots rather than a continuous line.

The same table also powers inequalities. To handle y>2x−3y > 2x - 3, graph the boundary line y=2x−3y = 2x - 3 from a table, then shade one side. The full steps are in graphing linear inequalities. A graphing calculator’s table feature does the same thing, so being able to read a table by hand lets you spot when a calculator entry has gone wrong.

Practice problems

0 of 5 solved

  1. Complete the table for y=2x+3y = 2x + 3 using x=−2,0,2x = -2, 0, 2.

  2. Find three points on y=−12x+4y = -\frac{1}{2}x + 4 using x=−6,0,4x = -6, 0, 4.

  3. Rewrite 4x−2y=84x - 2y = 8 as y=mx+by = mx + b, then find yy when x=3x = 3.

  4. A table has x=−1,2,5x = -1, 2, 5 and y=7,1,−5y = 7, 1, -5. Is it linear? If so, write the equation.

  5. A table has x=−3,1,5x = -3, 1, 5 and y=4,1,−2y = 4, 1, -2. Show it is linear and write the equation.

Common questions

How many points do you need to graph a line from a table of values?

Two points determine a line, but use at least three. If the third point does not fall on the line through the first two, you have made an arithmetic or plotting error.

What x-values should you pick for a table of values?

Include 00, one or two positive values and one or two negative values. If the equation has a fraction like 23x\frac{2}{3}x, choose multiples of the denominator so every yy comes out whole.

How do you make a table of values if the equation is not solved for y?

Solve for yy first, dividing every term by the coefficient of yy. You can also substitute each xx into the original equation and solve the small leftover equation for yy.

How do you graph a line from a table of values when the line is vertical?

A vertical line x=kx = k has the same xx-value in every row, so choose the yy-values instead. Plot (k,y)(k, y) for several yy and draw a vertical line through them.

How can you tell if a table of values is linear?

Compute ΔyΔx\frac{\Delta y}{\Delta x} between each pair of neighboring rows. If every ratio is the same, the table is linear and that ratio is the slope.

Do you put arrows on the ends of a line graph?

Yes, when the line continues forever in both directions, as most equations do. In a real-life problem where xx cannot be negative, such as miles driven, the graph starts at a point and has an arrow on one end only.

Up next