Function Families

How to Graph Logarithmic Functions

The graph of y = log_b(x) (b > 1) passes through (1, 0) and (b, 1), exists only for x > 0, and has the y-axis x = 0 as a vertical asymptote. It rises slowly to the right and drops steeply toward the asymptote. For y = a·log_b(x − h) + k, the asymptote moves to x = h and the point (1, 0) moves to (h + 1, k).

Graph of y = log₂(x) through (1, 0), (2, 1) and (4, 2) with the vertical asymptote x = 0, alongside y = 2^x reflected in y = x.

Check it yourself: every example here can be loaded into the Logarithmic Graphing Calculator.

Open the Logarithmic Graphing Calculator

What a log graph looks like

A logarithm is the inverse of an exponential: y = log_b(x) means bʸ = x. That gives the parent log graph its features:

Feature y = log_b(x), b > 1
Domain x > 0
Range all real numbers
Vertical asymptote x = 0 (the y-axis)
x-intercept (1, 0)
Other key point (b, 1)
Behaviour increasing, slowly

For 0 < b < 1 the graph is reflected in the x-axis and decreases.

Mirror image of the exponential

Because log_b and bˣ are inverses, their graphs are reflections in the line y = x. Every point (p, q) on y = 2ˣ becomes (q, p) on y = log₂ x:

y = 2ˣ (0, 1) (1, 2) (2, 4) (−1, ½)
y = log₂ x (1, 0) (2, 1) (4, 2) (½, −1)

The exponential’s horizontal asymptote y = 0 becomes the log’s vertical asymptote x = 0.

Try it in the calculator

Transformations

y = a·log_b(x − h) + k
  • h moves the asymptote to x = h and the domain becomes x > h.
  • k moves the graph up or down.
  • a stretches it; a < 0 flips it upside down.
  • Key points: (h + 1, k) and (h + b, a + k).
Graph of y = log base 3 of (x + 2), minus 1, with vertical asymptote x = −2, key points (−1, −1) and (1, 0), and domain x > −2.
Move the asymptote and the key points, then draw the slow-rising curve.
Text description of this figure

Graph of y = log base 3 of (x + 2), minus 1, with vertical asymptote x = −2, key points (−1, −1) and (1, 0), and domain x > −2.

  1. Asymptote: x + 2 = 0, so x = −2. Domain x > −2.
  2. Point (1, 0) of log₃ x moves to (−1, −1).
  3. Point (3, 1) moves to (1, 0) — the x-intercept.
  4. Point (9, 2) moves to (7, 1).

Step by step: y = log₃(x + 2) − 1

  1. Domain and asymptote. x + 2 > 0, so x > −2. Draw the dashed line x = −2.
  2. Key points of log₃ x: (1, 0), (3, 1), (9, 2), (1⁄3, −1).
  3. Shift each one 2 left and 1 down: (−1, −1), (1, 0), (7, 1), (−5⁄3, −2).
  4. Sketch through the points, dropping steeply toward x = −2 and rising slowly to the right.

The x-intercept is (1, 0); the y-intercept is log₃(2) − 1 ≈ −0.37.

Try it in the calculator

Finding the x-intercept algebraically

Set y = 0 and rewrite in exponential form: a·log_b(x − h) + k = 0 → log_b(x − h) = −k ⁄ a → x = h + b^(−k⁄a). For y = log₃(x + 2) − 1: x = −2 + 3¹ = 1 ✓.

Comparing bases

Larger bases give flatter log graphs. All of them pass through (1, 0):

  • log₂ x reaches 3 at x = 8,
  • ln x reaches 3 at x ≈ 20.1,
  • log₁₀ x reaches 3 at x = 1000.

See natural log vs common log for the difference between ln and log.

Common mistakes

  • Shifting the wrong way. log(x + 2) moves the graph 2 left.
  • Drawing the curve crossing the asymptote or continuing for x ≤ h.
  • Giving the log graph a horizontal asymptote. It keeps rising.
  • Entering ln as log in a calculator; they are different functions.

Questions

Why is there no graph to the left of the asymptote?

A logarithm answers 'what power of b gives x?'. No real power of a positive base gives zero or a negative number, so log_b(x) is undefined for x ≤ 0.

Does a log graph have a horizontal asymptote?

No. It grows without limit, just very slowly: log₁₀ x reaches 6 only at x = 1,000,000.

How do I graph ln(x)?

It is log base e ≈ 2.718. It passes through (1, 0) and (e, 1), between log₂ x and log₁₀ x.

Graph your own example with the Logarithmic Graphing Calculator — free, in your browser.

Try it now

Sources and further reading

Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.

Related guides

More in Function Families · All guides