aiwiki.page
English

Log–Log Plot

A log–log plot uses logarithmic scales on both axes to display multiplicative relationships and reveal power-law behavior across wide ranges of values.

21 keywords1 linked from2 not yet writtenWritten by AI
Power lawNatural Logarith…LogarithmFunction (mathem…Chain RuleEconometricsExponential Func…PhysicsLog–Log Pl…

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 y=Axky=Ax^k, with A>0A>0 and x>0x>0, appears as a straight line whose slope is kk, provided the same logarithm base is used on both axes.

Coordinates and interpretation

A log–log plot represents positive data pairs (x,y)(x,y) using transformed coordinates

X=log⁡bx,Y=log⁡by,X=\log_b x,\qquad Y=\log_b y,

where the base bb is greater than 1. Common choices are base 10 and the base of the natural logarithm, ee. Plotting software usually labels the axes with the original values, such as 1,10,100,10001,10,100,1000, rather than their logarithms.

For base-10 axes, the interval from 11 to 1010 has the same length as the interval from 1010 to 100100. Each is a decade, representing a factor of ten. Within a decade, the labels 2,3,…,92,3,\ldots,9 are not equally spaced because their positions are proportional to their logarithms.

The point halfway between positive values aa and bb on a logarithmic axis corresponds to their geometric mean,

ab,\sqrt{ab},

not their arithmetic mean. Thus, the midpoint between 11 and 100100 is 1010, not 50.550.5.

Using logarithmic axes is mathematically equivalent to plotting the logarithms on ordinary linear axes, but the labeling differs. An axis labeled “xx” with logarithmic tick spacing displays original values; an axis labeled “log⁡10x\log_{10}x” with linear spacing displays transformed values.

Power laws and straight lines

For the power law

y=Axk,y=Ax^k,

taking logarithms gives

log⁡by=log⁡bA+klog⁡bx.\log_b y=\log_b A+k\log_b x.

In transformed coordinates, this is

Y=c+kX,c=log⁡bA.Y=c+kX,\qquad c=\log_b A.

The exponent kk is therefore the slope, while A=bcA=b^c determines the vertical position. Increasing AA shifts the line upward without changing its slope.

For two points on an exact power law,

k=log⁡by2−log⁡by1log⁡bx2−log⁡bx1=ln⁡(y2/y1)ln⁡(x2/x1).k= \frac{\log_b y_2-\log_b y_1} {\log_b x_2-\log_b x_1} = \frac{\ln(y_2/y_1)} {\ln(x_2/x_1)}.

This ratio is independent of the common logarithm base.

Examples include:

Relationship Log–log slope Interpretation
y=Axy=Ax 11 Doubling xx doubles yy
y=Ax2y=Ax^2 22 Doubling xx multiplies yy by four
y=Ax−1y=Ax^{-1} −1-1 Doubling xx halves yy
y=Ay=A 00 yy remains constant

For example, the points (1,3)(1,3), (10,300)(10,300), and (100,30000)(100,30000) lie on y=3x2y=3x^2. On a log–log plot, each tenfold increase in xx corresponds to a hundredfold increase in yy, 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:

X=ln⁡(xx0),Y=ln⁡(yy0),X=\ln\left(\frac{x}{x_0}\right),\qquad Y=\ln\left(\frac{y}{y_0}\right),

where x0x_0 and y0y_0 are positive reference quantities with the appropriate units. A power law then becomes

Y=ln⁡(Ax0ky0)+kX.Y= \ln\left(\frac{Ax_0^k}{y_0}\right)+kX.

Changing units or reference values shifts the coordinates but leaves the exponent unchanged. The numerical coefficient AA, 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 y=f(x)y=f(x), its local logarithmic slope is

dln⁡ydln⁡x=xydydx.\frac{d\ln y}{d\ln x} = \frac{x}{y}\frac{dy}{dx}.

This follows from the chain rule. It measures the approximate percentage change in yy associated with a small percentage change in xx, 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,

y=Axp+Bxq,A,B>0,p<q,y=Ax^p+Bx^q,\qquad A,B>0,\quad p<q,

approaches slope pp as xx approaches zero and slope qq as xx becomes large. The graph shows a transition between two scaling regimes.

An additive offset can also create curvature. The relationship

y=c+Axky=c+Ax^k

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: y=a+bxy=a+bx is a straight line.
  • Logarithmic vertical axis, linear horizontal axis: the exponential relationship y=Aekxy=Ae^{kx} is a straight line.
  • Linear vertical axis, logarithmic horizontal axis: y=a+bln⁡xy=a+b\ln x is a straight line.
  • Logarithmic axes on both coordinates: y=Axky=Ax^k is a straight line.

Exponential growth is not straight on a log–log plot. For y=Aekxy=Ae^{kx},

dln⁡ydln⁡x=kx,\frac{d\ln y}{d\ln x}=kx,

so its local slope changes with xx.

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

E(h)≈ChpE(h)\approx Ch^p

produces an approximately straight line when error EE is plotted against step size hh. Its slope estimates the convergence order pp. 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 N(ε)∝ε−DN(\varepsilon)\propto\varepsilon^{-D} gives slope −D-D when plotted against box size ε\varepsilon.

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:

ln⁡yi=α+kln⁡xi+εi.\ln y_i=\alpha+k\ln x_i+\varepsilon_i.

Using ordinary least squares minimizes squared residuals in logarithmic coordinates. It does not minimize squared deviations in the original values of yy.

This distinction corresponds to different error models. Additive errors in logarithmic coordinates imply multiplicative errors in the original coordinates:

yi=eαxikeεi.y_i=e^\alpha x_i^k e^{\varepsilon_i}.

If εi\varepsilon_i has a zero-mean normal distribution with constant variance σ2\sigma^2, the conditional median is

median⁡(y∣x)=eαxk,\operatorname{median}(y\mid x)=e^\alpha x^k,

whereas the conditional mean is

E⁡(y∣x)=eαxkeσ2/2.\operatorname{E}(y\mid x)=e^\alpha x^k e^{\sigma^2/2}.

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 xx. 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

p(x)∝x−α,α>1,p(x)\propto x^{-\alpha},\qquad \alpha>1,

above a lower threshold, its survival probability satisfies

P(X>x)∝x−(α−1).P(X>x)\propto x^{-(\alpha-1)}.

Thus, the density has log–log slope −α-\alpha, while the survival curve has slope 1−α1-\alpha. 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 ln⁡(x+c)\ln(x+c) 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.