1
$\begingroup$

I was expecting

Plot[{Sin[x], Cos[x]}, {x, -1, 1}, PlotLabels -> Automatic]

and

Plot[Through[{Sin, Cos}[x]], {x, -1, 1}, PlotLabels -> Automatic]

to give the same result, as

Through[{Sin, Cos}[x]]

gives

{Sin[x], Cos[x]}

However I get this two different plots:

plot 1 plot 2

Is it a bug or do I misunderstand something? (maybe HoldAll Plot[] attribute does not mix well with Through[])

(I am running under Linux with MMA version 11.2.0 for Linux x86 (64-bit) (September 11, 2017))

$\endgroup$
0
3
$\begingroup$

Try with Evaluate

Plot[Through[{Sin, Cos}[x]] // Evaluate, {x, -1, 1},PlotLabels -> Automatic]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks, that fixes the problem! $\endgroup$ – Picaud Vincent Dec 15 '20 at 14:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.