I had an odd issue where my plot wasn't drawn correctly when I called it via Plot[Join[fs,gs], (*..*)]. However, these two versions worked:
funcs = Join[fs,gs]; Plot[funcs, (*..*)] (*1*)
plot[fs_] := Plot[fs,(*..*)]
plot[Join[fs,gs]] (*2*)
After a bit of playing around and a bit of research, I found out that explicitly Evaluate-ing the Join expression fixes the plot, so
Plot[Evaluate[Join[fs,gs]],(*..*)] (*3*)
works the same way as the two other examples. It turns out, Plot has the attribute HoldAll set whereas Set and SetDelayed do not.
Hence I suspect that $(1)$ and $(2)$ evaluate the Join expression before passing it to the plot. But
- Is there a reason why
Plotholds its arguments? - Does that mean if my expression for the plot gets more intricate, I should always
Evaluatejust to be sure? The documentation just says
In some cases, it may be more efficient to use Evaluate to evaluate f symbolically before specific numerical values are assigned to x.
Plotto localize the independent variable before evaluation so as to avoid any existing definition. $\endgroup$Evaluated -> Trueinstead ofEvaluate[funcs]. $\endgroup$