= Logarithmic scale
{title2=$u=\log_b(x/x_0)$}
{wiki}
A <logarithmic scale> places a positive quantity $x$ according to a <logarithm>, so equal <ratios> occupy equal distances. For example, $1,2,4,8$ are equally spaced under the <natural logarithm> because every successive difference is $\ln2$. An ordinary <linear scale> instead gives equal distances to equal differences: $1,2,3,4$.
For a base $b>1$ and a positive reference $x_0$, define the axis position
$$
u=\log_b(x/x_0),\qquad x>0.
$$
The reference has the same units as $x$, making $x/x_0$ a <dimensionless quantity>. The distance between two positions is
$$
u_2-u_1=\log_b(x_2/x_1).
$$
Multiplying both values by the same positive factor preserves that distance. Replacing $x_0$ by $cx_0$ translates every position by $-\log_b c$; changing the base rescales positions through $\log_b z=\ln z/\ln b$. Neither change alters which <ratios> receive equal gaps.
In base ten, the values $1,10,100,1000$ occupy positions $0,1,2,3$ when $x_0=1$. The differences between neighboring values grow from nine to ninety to nine hundred, but every step spans one <order of magnitude>. The values $2,20,200$ occupy positions $0.30103,1.30103,2.30103$: the same spacing shifted by $\log_{10}2$. This lets one plot small and large positive quantities together while keeping equal proportional changes equally visible.
A <logarithmic scale> is a rule for position, not an instruction to relabel the tick marks with their <logarithms>. A mark labelled $100$ still means the original value one hundred. Ordinary real <logarithms> exclude zero and negative inputs. Omitting such values or clipping them to a plotting boundary does not give them genuine logarithmic positions; the plotting choice needs to be clear.<Matplotlib 3.10.7 documentation/Log scale>[Matplotlib 3.10.7 documentation; Matplotlib 3.10.7, Log scale: Logarithms with other bases and Dealing with negative values]{ref}
Back to article page