0

When I execute

Plot[{(# + 1 &)[x], (2*# + 3 &)[x]}, {x, -2, 2}]

I get the following plots of different colours (as per the documentation):

enter image description here

But when I execute

{# + 1 &, 2*# + 3 &} // Plot[x // # // Through, {x, -2, 2}] &

the plots have the same blue colour:

enter image description here

Why don't the plots have different colours in the second case, even though the logic results in an equivalent expression?

Shredderroy
  • 5,249
  • 17
  • 26
  • 4
    Use this {# + 1 &, 2*# + 3 &} // Plot[Evaluate[x // # // Through], {x, -2, 2}] & – zhk Mar 06 '19 at 06:49
  • This suggestion definitely works for the simple functions above. But in my actual code, I have a list of trained models, and with that list I get the following error: PredictorFunction: Incompatible variable type (Numerical) and variable value (x). But then it does go on to plot them anyway. – Shredderroy Mar 06 '19 at 06:55

0 Answers0