When I do

Plot[{fun1,fun2} ./ val1->1,{t,0,10}]

then both plots are in the same color! If I use instead

Plot[{fun1./ val1->1,fun2./ val1->1},{t,0,10}]

it uses different colors, as expected. This is very annoying, particularly because often I supply a list already and need to perform last pattern substitutions...

If possible, the solution should not be supplying colors manually. I would look either for a setting to disable this behavior or something like "hold all" in MATLAB which automatically picks colors without manually supplying it.


Just wrap substitution by Evaluate[]:

Plot[Evaluate[{Sin[val1 x], Cos[val1 x]} /. val1 -> 1], {x, 0, 2 Pi}]
| improve this answer | |
  • 2
    $\begingroup$ I recommend using Evaluated -> True instead. Please see: (7561), (7832) $\endgroup$ – Mr.Wizard Nov 6 '14 at 8:52

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