Semi-log Plots
Exponential data curve sharply on ordinary axes, which makes them hard to read and harder to fit. A semi-log plot puts the vertical axis on a logarithmic scale and turns them into straight lines. This guide shows why, and how to move between the line and the exponential model.
In a semi-log plot, one axis (usually the vertical one) is on a logarithmic scale, so each step up multiplies \(y\) by the same factor. Taking logs of \(y = ab^x\) gives \(\log_n y = (\log_n b)x + \log_n a\), a line in \(x\) and \(\log_n y\) with slope \(\log_n b\) and intercept \(\log_n a\). So exponential data look linear on a semi-log plot, and the usual line-fitting tools (slope from two points, linear regression on \(\log y\)) work there. For large inputs, even data from a shifted exponential trend linear on a semi-log plot.
1What a semi-log plot is
The horizontal axis is ordinary. The vertical axis is marked 1, 10, 100, 1000 at equal spacing, so the height of a point is really \(\log y\). Plotting \(\log y\) against \(x\) on ordinary axes gives the same picture.
On a semi-log plot with vertical marks at 10 and 100, a point sits halfway between them. What is its y-value?
- 1Halfway in position means halfway in \(\log y\): between 1 and 2, so \(\log y = 1.5\).
- 2\(y = 10^{1.5} \approx 31.62\).
2Why exponentials become lines
For \(y = 3 \cdot 2^x\), write the equation of its graph on a base-10 semi-log plot.
- 1Take \(\log\) of both sides: \(\log y = \log 3 + \log 2^x = \log 3 + x\log 2\).
- 2With \(\log y\) on the vertical axis, that is a line: slope \(\log 2 \approx 0.301\), vertical intercept \(\log 3 \approx 0.477\).
“The points \((x, \log y)\) lie on a line with slope 0.301, so \(y\) is multiplied by \(10^{0.301} \approx 2\) for each 1-unit increase in \(x\): an exponential model fits.”
3From the line back to the model
Find the slope and intercept of the semi-log line, then undo the log: \(b = n^{\text{slope}}\) and \(a = n^{\text{intercept}}\). Base 10 and base \(e\) both work, as long as you undo with the same base.
On a base-10 semi-log plot, data lie along the line through \((0, 1.2)\) and \((4, 2.0)\), where the second coordinate is \(\log y\). Find the exponential model.
- 1Slope: \(\dfrac{2.0 - 1.2}{4 - 0} = 0.2\). So \(\log y = 0.2x + 1.2\).
- 2The slope is \(\log b\) and the intercept is \(\log a\): \(b = 10^{0.2} \approx 1.585\) and \(a = 10^{1.2} \approx 15.85\).
A semi-log slope of 0.2 does not mean \(b = 0.2\) (that would be decay). It means \(\log b = 0.2\), so \(b = 10^{0.2} \approx 1.585\).
If the vertical axis shows \(\ln y\), use \(e^{\text{slope}}\), not \(10^{\text{slope}}\). Mixing bases gives the wrong factor.
4Testing data
Take the log of each output. If the logs go up by roughly equal steps (for equally spaced inputs), the semi-log points lie on a line and an exponential model fits.
Is this growth exponential? If so, find the factor per hour.
| hour | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| count | 120 | 270 | 610 | 1370 | 3080 |
| \(\ln(\text{count})\) | 4.787 | 5.598 | 6.413 | 7.223 | 8.033 |
- 1Differences of \(\ln y\): 0.811, 0.815, 0.810, 0.810. Nearly constant, so the semi-log points lie close to a line: exponential.
- 2Average slope about 0.81, so the factor per hour is \(b \approx e^{0.81} \approx 2.25\). The intercept 4.787 gives \(a = e^{4.787} \approx 120\).
5Shifted exponentials
Data like \(y = 50 + 3 \cdot 2^x\) do not have constant ratios, so on ordinary axes you would have to subtract the right constant before the exponential pattern shows. On a semi-log plot, the points for large inputs already trend linear, because the constant becomes tiny compared with the exponential part.
Values of \(y = 50 + 3 \cdot 2^x\) for \(x = 0\) to 8 are plotted on a semi-log scale. Describe the pattern.
| \(x\) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| \(y\) | 53 | 56 | 62 | 74 | 98 | 146 | 242 | 434 | 818 |
| \(\log y\) | 1.724 | 1.748 | 1.792 | 1.869 | 1.991 | 2.164 | 2.384 | 2.637 | 2.913 |
- 1Consecutive differences of \(\log y\): 0.024, 0.044, 0.077, 0.122, 0.173, 0.220, 0.253, 0.276.
- 2They are not constant at first, but they climb toward \(\log 2 \approx 0.301\) as \(x\) grows, because \(3 \cdot 2^x\) swamps the 50.
- 3So for large inputs the semi-log points trend linear, which tells you a transformed exponential fits, without having to guess the 50 first.
In Figure 2 the first few points sit almost flat. A line through them would give a slope near 0.03 instead of 0.301. Judge the trend from the large inputs.
Quick reference
| Model | Semi-log line | Back to the model |
|---|---|---|
| \(y = ab^x\) | \(\log y = (\log b)x + \log a\) | \(b = 10^{\text{slope}}\), \(a = 10^{\text{intercept}}\) |
| \(y = ab^x\) | \(\ln y = (\ln b)x + \ln a\) | \(b = e^{\text{slope}}\), \(a = e^{\text{intercept}}\) |
| \(y = ab^x + k\) | Linear for large x only | Slope still near log b |