Finding the Equation of a Straight Line on a Semi-Log Plot Given Two Points

834 Views Asked by At

I want to learn how to create a straight line on an Excel semi-log graph of my data. An internet search pointed me to a similar answer on math.stackexchange.com: Finding the Equation of a Straight Line on a Log-Log Plot Given Two Points. But this is for a log-log chart, and I’ve not been able to figure out how to do this for a semi-log plot, where the x-axis is a linear time scale, and only the y-axis is logarithmic. I don’t see any answer to my question in the list of similar questions.

1

There are 1 best solutions below

0
On

When you plot a function $y = f(x)$ on an ordinary graph (no logarithmic scale), the horizontal distance of any point is proportional to $x$, the vertical distance is proportional to $y$, and a straight line has an equation like

$$ y = m x + b. $$

This is true even if the horizontal and vertical scales are not equal, for example if the $x$ axis has marks labeled $1,$ $2,$ $3$ and the $y$-axis is labeled in millions.

When you plot functions on a log-log graph, the horizontal distance of any point is proportional to $\ln(x)$, the vertical distance is proportional to $\ln(y)$, and a straight line has an equation like

$$ \ln(y) = m \ln(x) + B. $$

If you want $y$ as a function of $x$ you need to solve that equation for $y,$ and you get $y = b x^m$ where $b = e^B,$ as shown in Finding the Equation of a Straight Line on a Log-Log Plot Given Two Points.

Note that this works even when (as is often the case) the logarithmic scales are marked in powers of some number other than $e,$ because the logarithm of any base is proportional to the logarithm of any other base.

When you plot functions on a semi-log graph with $y$ plotted on a logarithmic scale and $x$ plotted on a linear scale, the horizontal distance of any point is proportional to $x$, the vertical distance is proportional to $\ln(y)$, and a straight line has an equation like

$$ \ln(y) = m x + B. $$

Solving for $y,$

\begin{align} y &= e^{m x + B} \\ &= e^B \cdot (e^m)^x \\ &= b k^x \end{align}

where $b = e^B$ and $k = e^m.$ So you're looking for an equation in the form $y = b k^x$ with suitable constants $b$ and $k.$


Just for the sake of completeness, if you happen to be plotting data on a semi-log graph with a logarithmic scale for $x$ and a linear scale for $y,$ the horizontal distance of any point is proportional to $\ln(x)$, the vertical distance is proportional to $y$, and a straight line has an equation like

$$ y = m \ln(x) + b. $$