1

I am using Mathematica 10.2.0.0

First, I define the following function

Clear[fermi]
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, 
  5}]

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, 
  4}]

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

LLlAMnYP
  • 11,486
  • 26
  • 65
matheorem
  • 17,132
  • 8
  • 45
  • 115
  • 5
    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. – Patrick Stevens Sep 27 '15 at 12:08
  • @PatrickStevens Why I have to add Plotrange->All? The Range is already declared as {-3,4} – matheorem Sep 27 '15 at 12:17
  • 3
    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. – Patrick Stevens Sep 27 '15 at 12:21
  • 1
    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 – bill s Sep 27 '15 at 12:21
  • @bills I don't think mathematica done it properly in this example. In {3,4} range, the variation is drastic and is apparently important , at least much important than the behaviour in {4,5} range, but why mathematica draw {4,5} while refused to draw {3,4}? – matheorem Sep 27 '15 at 12:27
  • @PatrickStevens I add a comment to bills – matheorem Sep 27 '15 at 12:27
  • @PatrickStevens I just don't understand, if mathematica refused to draw {3,4}, it has a fine reason not to draw {4,5}, but it draws. – matheorem Sep 27 '15 at 12:29
  • @matheorem You can run Plot[AbsoluteOptions[ Plot[Table[fermi[ee, 3, T], {T, 0.5, 2000, 300}] // Evaluate, {ee, -3, n}], PlotRange][[1, 2, 2, 1]], {n, -3, 5}] to show how its plot range varies with the upper bound on the domain. It just presumably thinks those are the features you're interested in. mma.SE doesn't seem to know how PlotRange is calculated: https://mathematica.stackexchange.com/questions/71808/plotrange-automatic-the-exact-function-used-to-calculate-outliers – Patrick Stevens Sep 27 '15 at 12:36
  • @PatrickStevens OK, thank you. I think I have to add Plotrange->All to all the plots I will make in the future. – matheorem Sep 27 '15 at 12:52
  • 1
    @matheorem You'll be glad of this behaviour when you try Plot[1/x, {x, 0, 5}]. – Patrick Stevens Sep 27 '15 at 12:56
  • 2
    @matheorem Remember you can use SetOptions[Plot, PlotRange -> All] for that. – Mr.Wizard Sep 27 '15 at 14:54
  • @Mr.Wizard Wow! Thank you Mr. Wizard for telling me this useful option! I really didn't know this before. – matheorem Sep 28 '15 at 00:27
  • @matheorem There are several layers of customization regarding plotting and graphics, including explicit options, set options, Box options, and Themes. We should probably have a post providing an overview of those. I attempted that for Front End options here: (72989) I'll try to do that in the next few days. – Mr.Wizard Sep 28 '15 at 00:43
  • @Mr.Wizard I can't agree more on this. Thank you so much for your work. – matheorem Sep 28 '15 at 04:51

0 Answers0