1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Logarithmic Scale

  1. Aug 24, 2012 #1
    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!

  2. jcsd
  3. Aug 24, 2012 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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.
  4. Aug 26, 2012 #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!
  5. Aug 26, 2012 #4


    User Avatar
    Homework Helper

    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##.
  6. Aug 26, 2012 #5


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes, except that the 'origin' is where x=1, y=1 (so log(x) = 0).
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Logarithmic Scale Date
Logarithm scale graph Oct 7, 2016
Question on logarithmic scale Jun 6, 2012
Linear to logarithmic scale conversion Feb 27, 2010
Logarithmic vs exponential scales Jan 22, 2010
Logarithmic Scale Apr 3, 2009