1
$\begingroup$

I want to vary a parameter via assumptions in a simple line plot and assign a different line color to each parameter value. Unfortunately all lines are the same color. I also tried to use Evaluate[], but no change at all. Any hint? Here's a minimal example:

Plot[Sin[\[CapitalDelta]\[Phi] + 2 T \[Omega]] /. {\[Omega] -> 1, 
       T -> {1, 2, 3}}, {\[CapitalDelta]\[Phi], -2 \[Pi], 2 \[Pi]}, 
     PlotStyle -> {{Black, Red, Blue}}]
$\endgroup$
2
  • $\begingroup$ try Plot[Evaluate[ Sin[\[CapitalDelta]\[Phi] + 2 T \[Omega]] /. {\[Omega] -> 1, T -> {1, 2, 3}}], {\[CapitalDelta]\[Phi], -2 \[Pi], 2 \[Pi]}, PlotStyle -> {Black, Red, Blue}]? $\endgroup$
    – kglr
    Commented Jul 25, 2019 at 17:33
  • $\begingroup$ That did the trick; don't know what I did wrong before hand. Thanks! $\endgroup$
    – Nikolaij H
    Commented Jul 25, 2019 at 17:41

1 Answer 1

0
$\begingroup$
  1. Use Evaluate on the function list in the first argument of Plot.
  2. Use {Black, Red, Blue} as the PlotStyle option setting. (Not {{Black, Red, Blue}}.)

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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