Good day to everyone.

I have some strange problem with ListContourPlot function combined with Log scaling.

For example, I build a table, like:

A = ParallelTable[{a, b, Log[1 + (b/a)]}, {a, 1, 20, 1.}, {b, {10^-3., 10^-2, 10^-1, 10^0, 10^1, 10^2, 10^3}}];

And ask Mathematica to plot a contour plot:

ListContourPlot[Flatten[A, 1], PlotRange -> Automatic]


Looks nice, but I see that the vertical axe needs to be scaled with a log-scaling function:

ListContourPlot[Flatten[A, 1], PlotRange -> All, PlotLegends -> Automatic, InterpolationOrder -> 2, ScalingFunctions -> {None, "Log", None}, DataRange -> {{1, 20}, {10^-3, 10^3}}]

And get something that has no sense to me.


So, where is the catch, what went wrong with my reasoning?

  • 1
    $\begingroup$ Here is an attempt. $\endgroup$
    – Syed
    Nov 2 '21 at 12:57
  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Nov 2 '21 at 13:39

Do not use DataRange in this case, instead use PlotRange like this

ListContourPlot[Flatten[A, 1], 
 PlotRange -> {{1, 20}, {10^-3, 10^3}, All}, PlotLegends -> Automatic,
  InterpolationOrder -> 2, ScalingFunctions -> {None, "Log", None}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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