# Semi-log plot

In science and engineering, a semi-log plot/graph or semi-logarithmic plot/graph has one axis on a logarithmic scale, the other on a linear scale. It is useful for data with exponential relationships, where one variable covers a large range of values.
All equations of the form $y=\lambda a^{\gamma x}$ form straight lines when plotted semi-logarithmically, since taking logs of both sides gives
    $\log _{a}y=\gamma x+\log _{a}\lambda .$
This is a line with slope $\gamma$ and $\log _{a}\lambda$ vertical intercept. The logarithmic scale is usually labeled in base 10; occasionally in base 2:
    $\log(y)=(\gamma \log(a))x+\log(\lambda ).$
A log–linear (sometimes log–lin) plot has the logarithmic scale on the y-axis, and a linear scale on the x-axis; a linear–log (sometimes lin–log) is the opposite. The naming is output–input (y–x), the opposite order from (x, y).
On a semi-log plot the spacing of the scale on the y-axis (or x-axis) is proportional to the logarithm of the number, not the number itself. It is equivalent to converting the y values (or x values) to their log, and plotting the data on linear scales. A log–log plot uses the logarithmic scale for both axes, and hence is not a semi-log plot.

## Equations

The equation of a line on a linear–log plot, where the abscissa axis is scaled logarithmically (with a logarithmic base of n), would be
    $F(x)=m\log _{n}(x)+b.\,$
The equation for a line on a log–linear plot, with an ordinate axis logarithmically scaled (with a logarithmic base of n), would be:
    $\log _{n}(F(x))=mx+b$
    $F(x)=n^{mx+b}=(n^{mx})(n^{b}).$

### Finding the function from the semi–log plot
#### Linear–log plot

On a linear–log plot, pick some fixed point (x$_0$, F$_0$), where F$_0$ is shorthand for F(x$_0$), somewhere on the straight line in the above graph, and further some other arbitrary point (x$_1$, F$_1$) on the same graph. The slope formula of the plot is:
    $m={\frac {F_{1}-F_{0}}{\log _{n}(x_{1}/x_{0})}}$
which leads to
    $F_{1}-F_{0}=m\log _{n}(x_{1}/x_{0})$
or
    $F_{1}=m\log _{n}(x_{1}/x_{0})+F_{0}=m\log _{n}(x_{1})-m\log _{n}(x_{0})+F_{0}$
which means that $F(x)=m\log _{n}(x)+\mathrm {constant}$
In other words, F is proportional to the logarithm of x times the slope of the straight line of its lin–log graph, plus a constant. Specifically, a straight line on a lin–log plot containing points (F$_0$, x$_0$) and (F$_1$, x$_1$) will have the function:
    $F(x)=(F_{1}-F_{0}){\left[{\frac {\log _{n}(x/x_{0})}{\log _{n}(x_{1}/x_{0})}}\right]}+F_{0}=(F_{1}-F_{0})\log _{\frac {x_{1}}{x_{0}}}{\left({\frac {x}{x_{0}}}\right)}+F_{0}$

#### log–linear plot

On a log–linear plot (logarithmic scale on the y-axis), pick some fixed point (x$_0$, F$_0$), where F$_0$ is shorthand for F(x$_0$), somewhere on the straight line in the above graph, and further some other arbitrary point (x$_1$, F$_1$) on the same graph. The slope formula of the plot is:
    $m={\frac {\log _{n}(F_{1}/F_{0})}{x_{1}-x_{0}}}$
which leads to
    $\log _{n}(F_{1}/F_{0})=m(x_{1}-x_{0})$
Notice that n$^{logn(F1)}$ = F$_1$. Therefore, the logs can be inverted to find:
    ${\frac {F_{1}}{F_{0}}}=n^{m(x_{1}-x_{0})}$
or
    $F_{1}=F_{0}n^{m(x_{1}-x_{0})}$
This can be generalized for any point, instead of just F$_1$:
    $F(x)={F_{0}}n^{\left({\frac {x-x_{0}}{x_{1}-x_{0}}}\right)\log _{n}(F_{1}/F_{0})}$

## Real-world examples
### Phase diagram of water

In physics and chemistry, a plot of logarithm of pressure against temperature can be used to illustrate the various phases of a substance, as in the following for water:

### 2009 "swine flu" progression

While ten is the most common base, there are times when other bases are more appropriate, as in this example:
Notice that while the horizontal (time) axis is linear, with the dates evenly spaced, the vertical (cases) axis is logarithmic, with the evenly spaced divisions being labelled with successive powers of two. The semi-log plot makes it easier to see when the infection has stopped spreading at its maximum rate, i.e. the straight line on this exponential plot, and starts to curve to indicate a slower rate. This might indicate that some form of mitigation action is working, e.g. social distancing.

### Microbial growth

In biology and biological engineering, the change in numbers of microbes due to asexual reproduction and nutrient exhaustion is commonly illustrated by a semi-log plot. Time is usually the independent axis, with the logarithm of the number or mass of bacteria or other microbe as the dependent variable. This forms a plot with four distinct phases, as shown below.