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

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
 
Mathematics 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).
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top