# Plot[func,...] shows incorrect function, but ListPlot@Table[func,...] is correct

When trying to Plot the function

1/(1 + E^(((e + Quantity[-7.05, "Electronvolts"])
*(Quantity[1, 1/("BoltzmannConstant")]))/T))


I get an incorrect plot looking like

However, if I first evaluate the points with Table and then use ListLinePlot it works as expected

• I'm not sure why you want to keep the units in the definition of f, but the following works: f[e_, T_] := 1/(1 + E^(((e + -7.05)*1)/T)). A good start when Plot returns an empty plot is to evaluate the function for some arbitrary values. Try and you'll understand why nothing plots. Mar 27 '18 at 20:27
• If you really must have units: With[{T = 5000}, Plot[1/(1 + E^(((Quantity[e, "Electronvolts"] + Quantity[-7.05, "Electronvolts"])*(Quantity[1, 1/("BoltzmannConstant")]))/Quantity[T, "Kelvins"])) // Evaluate, {e, 1, 20}]] Mar 28 '18 at 1:13
• @anderstood Whenever Plot returns nothing I always evaluate the function for arbitrary values. That's why, after Plot failed, I replaced Plot with Table. As you can see, evaluating the function for arbitrary values in Table works. And when I ListPlot those arbitrary values, the function works. My question was why Plot fails when the function successfully evaluates for arbitrary values. Mar 28 '18 at 10:35

fp[t_] := f[Quantity[t, "seconds"]]

The problem seems to be that Plot does not always pass the parameter to f with units. It seems like Echos are able to show what happens:
Plot[Echo[f[Echo[t]]], {t, Quantity[0.0, "Seconds"], Quantity[0.004, "Seconds"]}]