Graphing Linear Functions: Slope & Intercept
Two numbers, m and b, are all you need to draw — and understand — any straight line.
A line is a rule, not just a picture
A straight line on a graph is really a rule: give it an input x, and it hands back an output y. Linear functions are the simplest rule of all — the output changes by the same amount every time the input goes up by one. That steady, predictable change is exactly what makes a line straight.
Remarkably, you only need two numbers to pin down that rule completely.
Meet m and b by moving them
The fastest way to feel what m and b do is to change them and watch. Drag the two sliders below. Notice how m tilts the line (positive tilts up to the right, negative tilts down, zero is flat) and how b slides the whole line up and down without changing its steepness.
Graphing a line in two moves
Once you can read m and b, graphing is quick:
- Plot the intercept. Put a dot at (0, b) on the y-axis.
- Use the slope to step. Write m as rise/run. From the intercept, move run to the right and rise up (or down, if the rise is negative), and plot a second point. Connect them.
- Read off the numbers: slope m = 2, intercept b = −3.
- Plot the y-intercept first: a dot at (0, −3).
- Write the slope as rise/run: 2 = 2/1, so from (0, −3) move 1 right and 2 up to reach (1, −1).
- Draw the straight line through (0, −3) and (1, −1).
- The y-intercept is 4, so b = 4.
- Rise over run: it drops 1 (rise = −1) over a run of 3, so m = −1/3.
- Substitute into y = mx + b.
Check your understanding
- Any straight line can be written y = mx + b.
- m is the slope — how much y changes per step right; its sign sets the tilt.
- b is the y-intercept — the line always passes through (0, b).
- Graph a line by plotting (0, b) first, then stepping by the slope's rise over run.
- The slope is the coefficient of x — reorder the equation if needed before reading it.