4
$\begingroup$

Bug introduced in 11.0 and fixed in 11.0.1


I'm trying to plot a sequence of functions. I wrote the code in two seemingly equivalent ways, but it produces different results. First method:

FX = Table[(x - 1 + d)/(1 + x), {d, 0, 1, 0.2}]
LogLinearPlot[FX, {x, 1, 1000}, PlotRange -> {{1, 1000}, {0, 1}}]

Here is the result:

First method

This didn't look right, so I repeated the same thing a second time, except this time I substituted the list directly into the plotting command:

LogLinearPlot[{(-1. + x)/(1 + x), (-0.8 + x)/(1 + x), (-0.6 + x)/(
  1 + x), (-0.4 + x)/(1 + x), (-0.2 + x)/(1 + x), (0. + x)/(
  1 + x)}, {x, 1, 1000}, PlotRange -> {{1, 1000}, {0, 1}}]

Here is the result...

Second method

Clearly the plots are different (the second one is correct). If I do an ordinary Plot command the plots are identical. Any idea what's going on? I'm using Mathematica 11.0. I did a bit of testing, and it appears that if I use the command:

Plot[FX, {x, 0, Log[1000]}, PlotRange -> {{0, Log[1000]}, {0, 1}}]

I can reproduce the same curves as in the first plot. So apparently it's actually using linear scales for the LogLinearPlot command when I pass it a list...

$\endgroup$
  • $\begingroup$ 11.0.0 or 11.0.1? In 11.0.1 I get identical graphs for both (well the coloring differs, but small matter). Consider upgrading? $\endgroup$ – user6014 Mar 9 '17 at 0:49
  • 1
    $\begingroup$ definitely a bug. Fixed in 11.0.1. The coloring issue is fixed in a future release. $\endgroup$ – rcollyer Mar 9 '17 at 1:01
  • $\begingroup$ Aha! Thanks --- I'll upgrade. $\endgroup$ – Laurent Lessard Mar 9 '17 at 3:43
  • $\begingroup$ For proper coloring, use Evaluate: LogLinearPlot[Evaluate@FX, {x, 1, 1000}, PlotRange -> {0, 1}] $\endgroup$ – Bob Hanlon Mar 9 '17 at 3:51

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.