A log–log plot is a graph in which both coordinate axes use a logarithmic scale. Equal distances along either axis represent equal ratios rather than equal differences. This makes the plot useful for displaying quantities that span many orders of magnitude and for examining power-law relationships: a function of the form , with and , appears as a straight line whose slope is , provided the same logarithm base is used on both axes.
Coordinates and interpretation
A log–log plot represents positive data pairs using transformed coordinates
where the base is greater than 1. Common choices are base 10 and the base of the natural logarithm, . Plotting software usually labels the axes with the original values, such as , rather than their logarithms.
For base-10 axes, the interval from to has the same length as the interval from to . Each is a decade, representing a factor of ten. Within a decade, the labels are not equally spaced because their positions are proportional to their logarithms.
The point halfway between positive values and on a logarithmic axis corresponds to their geometric mean,
not their arithmetic mean. Thus, the midpoint between and is , not .
Using logarithmic axes is mathematically equivalent to plotting the logarithms on ordinary linear axes, but the labeling differs. An axis labeled “” with logarithmic tick spacing displays original values; an axis labeled “” with linear spacing displays transformed values.
Power laws and straight lines
For the power law
taking logarithms gives
In transformed coordinates, this is
The exponent is therefore the slope, while determines the vertical position. Increasing shifts the line upward without changing its slope.
For two points on an exact power law,
This ratio is independent of the common logarithm base.
Examples include:
| Relationship | Log–log slope | Interpretation |
|---|---|---|
| Doubling doubles | ||
| Doubling multiplies by four | ||
| Doubling halves | ||
| remains constant |
For example, the points , , and lie on . On a log–log plot, each tenfold increase in corresponds to a hundredfold increase in , producing a line of slope 2.
The slope is a ratio of changes in transformed coordinates, not simply the line’s apparent angle on a page. Changing the graph’s aspect ratio changes its visual angle without changing the exponent. If different logarithm bases are used on the two axes, the coordinate slope also requires a base-conversion factor.
Units and reference quantities
For physical quantities, logarithms can be expressed in terms of dimensionless ratios:
where and are positive reference quantities with the appropriate units. A power law then becomes
Changing units or reference values shifts the coordinates but leaves the exponent unchanged. The numerical coefficient , however, generally depends on the chosen units.
Curvature and local scaling
A curved log–log graph indicates that a single power-law exponent does not describe the entire plotted range. For a positive differentiable function , its local logarithmic slope is
This follows from the chain rule. It measures the approximate percentage change in associated with a small percentage change in , and is also called an elasticity in econometrics.
For an exact power law, this slope is constant. For a sum of powers, it can vary. For example,
approaches slope as approaches zero and slope as becomes large. The graph shows a transition between two scaling regimes.
An additive offset can also create curvature. The relationship
does not generally form a straight line on log–log axes, even though one term is a power law. Estimating an exponent without accounting for a baseline can therefore be misleading.
Comparison with other plots
A semi-log plot has only one logarithmic axis. Different coordinate choices linearize different relationships:
- Linear axes: is a straight line.
- Logarithmic vertical axis, linear horizontal axis: the exponential relationship is a straight line.
- Linear vertical axis, logarithmic horizontal axis: is a straight line.
- Logarithmic axes on both coordinates: is a straight line.
Exponential growth is not straight on a log–log plot. For ,
so its local slope changes with .
Log–log axes emphasize ratios and relative changes. Linear axes emphasize absolute differences. Neither representation is universally preferable; each highlights different properties of the data.
Applications
Log–log plots are widely used to compare measurements, theoretical predictions, and computational results across large ranges.
In physics, they display scaling relationships such as inverse-square laws and power-law dependence between physical quantities. A predicted exponent can be compared with the observed slope.
In numerical analysis, an error model
produces an approximately straight line when error is plotted against step size . Its slope estimates the convergence order . At very small step sizes, rounding effects associated with floating-point arithmetic can disrupt this trend.
In computer science, log–log plots can help compare measured runtime or memory use with power-law growth. An approximately straight segment does not by itself establish an asymptotic complexity bound: finite-size effects and logarithmic factors may alter the apparent slope.
In the study of fractals, counts or measures are often plotted against observation scale. For example, a box count satisfying gives slope when plotted against box size .
In statistics, log–log plots are used to inspect the tails of distributions and possible scaling relationships between variables.
Regression and statistical interpretation
A straight-looking pattern can motivate a power-law model, but it does not establish one. A common fitting procedure transforms the observations and applies linear regression:
Using ordinary least squares minimizes squared residuals in logarithmic coordinates. It does not minimize squared deviations in the original values of .
This distinction corresponds to different error models. Additive errors in logarithmic coordinates imply multiplicative errors in the original coordinates:
If has a zero-mean normal distribution with constant variance , the conditional median is
whereas the conditional mean is
Simply exponentiating a fitted logarithmic prediction therefore does not generally estimate the original-scale conditional mean.
Appropriate fitting also depends on measurement errors, dependence between observations, and whether variability changes with . Uncertainty in both coordinates may require methods beyond ordinary regression.
Distribution tails
A straight tail on log–log axes is suggestive of a power law, but visual inspection alone is weak evidence. Other distributions can resemble straight lines over limited ranges, and histogram binning can change the apparent pattern.
The quantity being plotted also matters. If a continuous probability density satisfies
above a lower threshold, its survival probability satisfies
Thus, the density has log–log slope , while the survival curve has slope . Confusing the two produces an exponent error of one.
With logarithmically spaced histogram bins, raw counts also reflect the increasing bin widths. Estimating a density requires normalization by bin width. Formal assessment of a power-law tail may involve maximum likelihood estimation, goodness-of-fit testing, and comparison with alternative distributions.
Limitations and presentation
Ordinary real-valued logarithmic axes require strictly positive coordinates. Zero has no finite logarithm, and negative values cannot be shown on a standard log–log plot. Omitting such observations can alter the interpretation of the displayed data.
Adding an arbitrary constant before taking logarithms is not a neutral remedy. Plotting changes ratios and can change an apparent scaling relationship. Signed logarithmic or symmetric-logarithmic scales can display nonpositive values, but do not preserve the standard power-law straight-line interpretation throughout their range.
Other important limitations include:
- Compression of absolute differences. Large numerical differences may appear visually modest.
- Limited scaling ranges. Many smooth relationships look approximately straight over a narrow interval.
- Sensitivity of local slopes to noise. Numerical estimates of derivatives can fluctuate strongly.
- Transformed uncertainty. Symmetric error bars on the original scale generally become asymmetric in logarithmic coordinates; bounds reaching zero cannot be displayed normally.
- Loss of context through cropping. Showing only an apparently linear segment can conceal thresholds, saturation, or changes in regime.
Clear presentation identifies the axis scales, units, plotted quantity, fitted range, and meaning of any reference slope. Tick labels should make clear whether they denote original values or logarithms.