Logarithmic Scale: What Happens When Plotting x,y Values?

In summary: So it's not really the origin, but the point (1,1).In summary, switching a plot from linear scale to log scale takes the logarithm of the values to determine their distance to the point (1,1) on the graph. This can be useful for data that spans a wide range of values and can also help to visualize power law behavior in the data.
  • #1
CharlieTan84
8
0
Hello people,

I have a question about the log-scale. What happens when we switch a plot from linear scale to the log scale?

Let's say I have two arrays: x values and corresponding y values. I plot them using a linear scale and then I switch to the log scale. What happens? Does the program take the log of the x values of what?

I would be glad if you answer my question. Thank you!

Charlie
 
Mathematics news on Phys.org
  • #2
What program?
In a log scale, you take the logarithm of the value to get the linear distance along the axis at which to plot that value. The label at that point on the axis is still the original x value.
 
  • #3
Hello haruspex,

Thank you very much for your answer. I am using gnuplot for my plots.

I think I am starting to get it. So a log scale takes the log of the x and y values to find their distance to x and y origin right? So the values are still the same but their placement/position is different. Am I right?

Thank you!
 
  • #4
CharlieTan84 said:
Hello haruspex,

Thank you very much for your answer. I am using gnuplot for my plots.

I think I am starting to get it. So a log scale takes the log of the x and y values to find their distance to x and y origin right? So the values are still the same but their placement/position is different. Am I right?

Thank you!

A log scale is basically just plotting log(y) vs. log(x). It's not much use to talk about the distance to the origin on a log scale because log(0) is ##-\infty##, so the origin will never appear on a logscale plot. (The difference between taking the log of your data and plotting it compared just plotting your data y vs. x is that in the latter case software will usually label the axis ticks with ##10^0,~10^{1}##, etc., while in the former case the ticks will just be 0, 1, etc.)

Logscale is particularly useful when your data spans several orders of magnitude (e.g., ##10^{-2}## to ##10^{6}##), as taking the log will reduce the span of the data.

It is also quite useful when you believe sections of your data plot may follow power law behavior, because it makes such plots linear. That is, if ##y = x^\alpha##, then

$$\log y = \alpha \log x,$$

and since you're plotting logy vs logx, you get a line with slope ##\alpha##.
 
  • #5
CharlieTan84 said:
Hello haruspex,

Thank you very much for your answer. I am using gnuplot for my plots.

I think I am starting to get it. So a log scale takes the log of the x and y values to find their distance to x and y origin right? So the values are still the same but their placement/position is different. Am I right?

Thank you!

Yes, except that the 'origin' is where x=1, y=1 (so log(x) = 0).
 

1. What is a logarithmic scale and how is it different from a linear scale?

A logarithmic scale is a type of scale used on graphs and charts that displays values in an exponential manner. This means that equal distances on the scale represent equal ratios, rather than equal differences, as seen on a linear scale. This makes it easier to visualize data that has a large range of values.

2. When should I use a logarithmic scale?

A logarithmic scale is most useful when dealing with data that has a large range of values, particularly if the values are exponentially increasing or decreasing. This includes data such as population growth, stock market trends, and earthquake magnitudes.

3. How does a logarithmic scale affect the interpretation of data?

A logarithmic scale can make it easier to compare values that differ by large orders of magnitude. However, it can also make it more difficult to accurately judge the magnitude of values, as the distances on the scale do not correspond to equal differences in the data.

4. Can I convert a logarithmic scale back to a linear scale?

Yes, it is possible to convert a logarithmic scale back to a linear scale. This can be done by taking the logarithm of each data point and then plotting it on a linear scale.

5. Are there any limitations to using a logarithmic scale?

While a logarithmic scale can be useful for visualizing certain types of data, it is not appropriate for all types of data. In some cases, it may not accurately represent the data or may make it more difficult to interpret accurately. It is important to consider the data and the purpose of the graph before deciding to use a logarithmic scale.

Similar threads

  • General Math
Replies
2
Views
9K
  • General Math
Replies
7
Views
1K
Replies
1
Views
1K
Replies
4
Views
2K
  • General Math
Replies
15
Views
2K
Replies
24
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
Replies
6
Views
2K
  • General Math
Replies
4
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
Back
Top