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

Click For Summary

Discussion Overview

The discussion revolves around the implications of switching a plot from a linear scale to a logarithmic scale, specifically in the context of plotting x and y values using gnuplot. Participants explore how the logarithmic transformation affects the representation of data points and the interpretation of the axes.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Charlie inquires about the effects of switching from a linear scale to a log scale, questioning what values are transformed and how they are plotted.
  • One participant explains that in a log scale, the logarithm of the value determines the linear distance along the axis, while the original value remains labeled on the axis.
  • Charlie expresses understanding that a log scale alters the placement of values but retains the original values, seeking confirmation of this interpretation.
  • Another participant clarifies that a log scale involves plotting log(y) against log(x) and notes that the concept of distance to the origin is not applicable due to the nature of logarithms.
  • The discussion highlights that log scales are beneficial for data spanning several orders of magnitude and for identifying power law relationships, as they can linearize such relationships.
  • There is a clarification that the 'origin' in a log scale context is where both x and y equal 1, corresponding to log(x) = 0.

Areas of Agreement / Disagreement

Participants generally agree on the mechanics of how logarithmic scales operate and their utility in certain contexts, though there is some uncertainty regarding the interpretation of axes and the concept of distance to the origin.

Contextual Notes

There are assumptions regarding the understanding of logarithmic functions and their graphical representation that may not be explicitly stated. The discussion does not resolve all nuances related to the application of log scales in various contexts.

CharlieTan84
Messages
8
Reaction score
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
 
Physics news on Phys.org
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.
 
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!
 
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##.
 
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).
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
16K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K