I am using Mathematica

First, I define the following function

fermi[ee_, EF_, T_] := 
 1/(E^((ee - EF)/(Subscript[k, B] T)) + 1) /. 
  Subscript[k, B] -> (1.38 10^-23/(1.6 10^-19))

then I plot it with several parameter T as

Plot[Evaluate@Table[fermi[ee, 3, T], {T, 0.5, 2000, 300}], {ee, -3, 

the result is pretty good, show here enter image description here

But strange thing happens when I change the plot interval of ee from {-3,5} to {-3,4},

Plot[Evaluate@Table[fermi[ee, 3, T], {T, 0.5, 2000, 300}], {ee, -3, 

Mathematica gives enter image description here What is wrong with these curves in the interval {3,4}?

  • 5
    $\begingroup$ Don't use the bugs tag unless it's confirmed a bug. In this case, you need to supply PlotRange -> All to get the behaviour you want. $\endgroup$ Sep 27, 2015 at 12:08
  • 3
    $\begingroup$ You haven't specified the output range at all, so Mathematica picks one it thinks shows the most important features and is aesthetically pleasing. It doesn't get it right here, but that's a matter of taste. The specification {ee, -3, 4} specifies the domain of the function, not its range. $\endgroup$ Sep 27, 2015 at 12:21
  • 1
    $\begingroup$ Read the docs for PlotRange: "With the Automatic setting, the distribution of coordinate values is found, and any points sufficiently far out in the distribution are dropped. Such points are often produced as a result of singularities in functions being plotted." This is why, in order to get all the points plotted, you need to use PlotRange>All $\endgroup$
    – bill s
    Sep 27, 2015 at 12:21
  • 1
    $\begingroup$ @matheorem You'll be glad of this behaviour when you try Plot[1/x, {x, 0, 5}]. $\endgroup$ Sep 27, 2015 at 12:56
  • 2
    $\begingroup$ @matheorem Remember you can use SetOptions[Plot, PlotRange -> All] for that. $\endgroup$
    – Mr.Wizard
    Sep 27, 2015 at 14:54


Browse other questions tagged or ask your own question.