# Semi-log plot

The log-lin type of a semi-log graph, defined by a logarithmic scale on the y-axis, and a linear scale on the x-axis. Plotted lines are: y = 10x (red), y = x (green), y = log(x) (blue).
The lin-log type of a semi-log graph, defined by a logarithmic scale on the x axis, and a linear scale on the y axis. Plotted lines are: y = 10x (red), y = x (green), y = log(x) (blue).

In science and engineering, a semi-log graph or semi-log plot is a way of visualizing data that are related according to an exponential relationship. One axis is plotted on a logarithmic scale.

This kind of plotting method is useful when one of the variables being plotted covers a large range of values and the other has only a restricted range – the advantage being that it can bring out features in the data that would not easily be seen if both variables had been plotted linearly.[1]

All equations of the form ${\displaystyle y=\lambda a^{\gamma x}}$ form straight lines when plotted semi-logarithmically, since taking logs of both sides gives

${\displaystyle \log _{a}y=\gamma x+\log _{a}\lambda .}$

This can easily be seen as a line in slope-intercept form with ${\displaystyle \gamma }$ as the slope and ${\displaystyle \log _{a}\lambda }$ as the vertical intercept. To facilitate use with logarithmic tables, one usually takes logs to base 10 or e, or sometimes base 2:

${\displaystyle \log(y)=(\gamma \log(a))x+\log(\lambda ).}$

The term log-lin is used to describe a semi-log plot with a logarithmic scale on the y-axis, and a linear scale on the x-axis. Likewise, a lin-log plot uses a logarithmic scale on the x-axis, and a linear scale on the y-axis. Note that 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 lin-lin 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 lin-log plot, where the abscissa axis is scaled logarithmically (with a logarithmic base of n), would be

${\displaystyle F(x)=m\log _{n}(x)+b.\,}$

The equation for a line on a log-lin plot, with an ordinate axis logarithmically scaled (with a logarithmic base of n), would be:

${\displaystyle \log _{n}(F(x))=mx+b}$
${\displaystyle F(x)=n^{mx+b}=(n^{mx})(n^{b}).}$

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

#### Lin-log plot

On a lin-log plot (logarithmic scale on the x-axis), pick some fixed point (x0, F0), where F0 is shorthand for F(x0), somewhere on the straight line in the above graph, and further some other arbitrary point (x1, F1) on the same graph. The slope formula of the plot is:

${\displaystyle m={\frac {F_{1}-F_{0}}{\log _{n}(x_{1}/x_{0})}}}$

${\displaystyle F_{1}-F_{0}=m\log _{n}(x_{1}/x_{0})}$

or

${\displaystyle F_{1}=m\log _{n}(x_{1}/x_{0})+F_{0}=m\log _{n}(x_{1})-\log _{n}(x_{0})+F_{0}}$

which means that

${\displaystyle F(x)=m*\log _{n}(x)+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 (F0x0) and (F1x1) will have the function:

${\displaystyle 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-lin plot

On a log-lin plot (logarithmic scale on the y-axis), pick some fixed point (x0, F0), where F0 is shorthand for F(x0), somewhere on the straight line in the above graph, and further some other arbitrary point (x1, F1) on the same graph. The slope formula of the plot is:

${\displaystyle m={\frac {\log _{n}(F_{1}/F_{0})}{x_{1}-x_{0}}}}$

${\displaystyle \log _{n}(F_{1}/F_{0})=m(x_{1}-x_{0})}$

Notice that nlogn(F1) = F1. Therefore, the logs can be inverted to find:

${\displaystyle {\frac {F_{1}}{F_{0}}}=n^{m(x_{1}-x_{0})}}$

or

${\displaystyle F_{1}=F_{0}n^{m(x_{1}-x_{0})}}$

This can be generalized for any point, instead of just F1:

${\displaystyle 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:

Log-lin pressure–temperature phase diagram of water. The Roman numerals indicate various ice phases.

### 2009 "swine flu" progression

While ten is the most common base, there are times when other bases are more appropriate, as in this example:

A semi-logarithmic plot of cases and deaths in the 2009 outbreak of influenza A (H1N1). 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.

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

Bacterial growth curve