## Saturday, 16 August 2008

### Graph In Logarithmic Scale

In graph plotting, we can have a choice to plot the raw data (from the math equation) directly using the conventional y- axis (vertical line) and x -axis (horizontal line) , or modifying the horizontal axis parameter to match the given math expression.

Which technique to use depends on our purpose.

If the objective is to present the data as it is, and revealing the trend the raw data ( y and x) gives regardless of its plotted profile, then the conventional y-axis and x-axis method suffices.

If the objective is to obtain a straight line graph from the non-linear (assumingly) math equation for analysis purpose, then the need to modify the horizontal axis parameter before plotting is required. Refer to this link for details on straight line conversion for non-linear math equations.

Example: y = log x

In direct plotting of the above expression, we will get a non-linear presentation as shown in Diagram 1 below. (The horizontal parameter is directly the "x" data.)

Diagram 1: Non-linear presentation of the y = log x (Horizontal axis: x)

When we desire to have a straight line graph, we can plot the horizontal axis with the modified data of "log x" to match the generic straight line equation of y = mx + c.

The below graph is plotted in Diagram 2 with the horizontal data as "log x". Here we should expect a straight line graph to appear.

Diagram 2: A straight line graph with modified horizontal axis of "log x" data.

** But note that this post will explain another method to achieve a straight line plot when the math equation involves the logarithmic operation. **

The disadvantage of the second method presented above involved the modification of the horizontal parameter which may results in confusion to the raw "x" data.

What this new plotting option involves is not the modification of the horizontal parameter but the re-adjustment of the division between the scales of the horizontal axis.

This re-adjustment of the horizontal scale results in the "Logarithmic Scale". This scale is a special scale that increases logarithmically while keeping the parameter as the raw "x" data in the math equation. The merit is the outcome is the desired straight line graph.

Let's see the y = log x expression plotted in the Logarithmic scale. (Diagram 3).

Diagram 3:
The straight line plot with Logarithmic scaling while keeping the raw "x" parameter.

Therefore, the math expression can be plotted using 2 techniques to achieve a straight line.

Logarithmic scale is commonly used in the plotting of frequency response of audio signal and filters. System stability is also analysed using logarithmic plots.

.