1
$\begingroup$

I am generating a set of plots and exploring how changing a parameter affects the plot shape. I want each plot to be a different color, but the color rule i'm applying seems to only work for the last color in the list. what is wrong with my syntax?

Vmorse[x_] = 
d*(Exp[-2 \[Alpha] (x - x0)] - 2 Exp[-\[Alpha] (x - x0)]);
morseSubsTest = {d -> 4.43, \[Alpha] -> {1.9, 1, 3}, x0 -> 1.13};

 Plot[Vmorse[x] /. morseSubsTest, {x, 0, 5}, PlotRange -> {-5, 0.5}, 
 PlotLabel -> "Morse Potential change alpha", 
 PlotStyle -> {Red, Green, Blue}]
$\endgroup$
3
$\begingroup$

Change to:

Plot[Evaluate@(Vmorse[x] /. morseSubsTest), {x, 0, 5}, 
 PlotRange -> {-5, 0.5}, PlotLabel -> "Morse Potential change alpha", 
 PlotStyle -> {Red, Green, Blue}]
$\endgroup$
  • $\begingroup$ I can't find a question showing the differences between using Evaluate[f[x]] and the Option Evaluated -> True ... but it's out there. Who can find it? $\endgroup$ – Dr. belisarius Mar 4 '14 at 1:27
  • $\begingroup$ @belisarius: This? mathematica.stackexchange.com/questions/11772/… $\endgroup$ – ciao Mar 4 '14 at 2:05

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.