Here is some very odd behavior from ListLogPlot.

So if I want to plot a function using LogPlot, I can specify the PlotRange in either {min,max} or {max,min} format.

LogPlot[x^6, {x, 0, 5}, PlotRange -> {10^-9, 10^5}]
LogPlot[x^6, {x, 0, 5}, PlotRange -> {10^5, 10^-9}]

enter image description here

So now I try to do the same thing with ListLogPlot I encounter an error:

list = Table[{x, x^6}, {x, 0, 5, .01}];
Grid[{{ListLogPlot[list, PlotRange -> {10^-9, 10^5}],
   ListLogPlot[list, PlotRange -> {10^5, 10^-9}]}}]

enter image description here enter image description here

Obviously the problem can be fixed by putting the PlotRange specification in order, but it can also be fixed by changing the x-coordinate grid spacing.

list = Table[{x, x^6}, {x, 0, 5, .02}];
ListLogPlot[list, PlotRange -> {10^5, 10^-9}]

enter image description here

That's weird. Weirder still - the more plots you try to show at the same time, the coarser you need to make the grid spacing to avoid the error. For two lists, we need $\Delta x>0.03$

(list = Table[{x, x^6}, {x, 0, 5, #}];
   ListLogPlot[{list, {#1, 10 #2} & @@@ list}, 
    PlotRange -> {10^5, 10^-9}]) & /@ {.02, .03}

enter image description here

Adding a third list, it is fine with $\Delta x>0.03$, but for a fourth list, $\Delta x>0.05$ is needed.

What is behind this odd behavior in ListLogPlot?

  • $\begingroup$ @JasonB Thanks for editing and bringing it right to the issue $\endgroup$ – Lukas Oct 23 '15 at 11:28

Your Answer

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

Browse other questions tagged or ask your own question.