I have data in Mathematica that comes from y-log scale

Data = {{5.0, 23.87548081003781},
   {6.94392523364486, 0.511639358262082},
   {8.925233644859812, 0.23397526329810545},
   {10.962616822429906, 0.16190746961888203},
   {12.906542056074766, 0.17751810380557045},
   {14.925233644859812, 0.25653445869951874}};

These points should be connected by straight line on log scale like this

ListLogPlot[Data, Joined -> True]

I want to find interpolated function with straight lines on log plot(just like above code), however naive result gives me:

LogPlot[Interpolation[Data, InterpolationOrder -> 1][x], {x, 5, 14}]

which does not have straight lines on logPlot, it has straight lines on Plot.

How can I interpolate data on log plot?

  • $\begingroup$ what if you use InterpolationOrder with ListLogPlot like ListLogPlot[Data, Joined -> True, InterpolationOrder -> 3] $\endgroup$
    – Sumit
    Commented Jul 9, 2017 at 9:11
  • $\begingroup$ Dear Sumit, thank you for the reply, this gives me a smoother plot, but I want an interpolated function which would look like ListLogPlot[Data, Joined -> True] $\endgroup$
    – Wint
    Commented Jul 9, 2017 at 9:28
  • 6
    $\begingroup$ It'll be due to the difference between interpolating in log space or linear space. This'll get you what you want: if = Exp@*Interpolation[{#1, Log[#2]} & @@@ Data, InterpolationOrder -> 1] then LogPlot[if[x], {x, 5, 14}] $\endgroup$ Commented Jul 9, 2017 at 9:47
  • $\begingroup$ Quantum_Oli thank you very much!! Please post as an answer and I mark it as solved. :) $\endgroup$
    – Wint
    Commented Jul 9, 2017 at 10:02

1 Answer 1


[Just noticed this was @Quantum_Oil's idea in a comment above. Probably why I didn't answer before.]

Often one interpolates to avoid transcendental functions, but the OP's objective cannot be achieved with polynomial interpolation. So I assume something like the following, which reproduces ListLogPlot[Data, Joined -> True], is desired:

logIF[x_] = 
  Exp[Interpolation[MapAt[Log, Data, {All, 2}], InterpolationOrder -> 1][x]];
LogPlot[logIF[x], {x, 5, 14}]

Mathematica graphics


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.