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}}]
  • $\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 Jul 25 at 17:33
  • $\begingroup$ That did the trick; don't know what I did wrong before hand. Thanks! $\endgroup$ – Nikolaij H Jul 25 at 17:41
  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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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