In Mathematica 13.2, while defining a function for manipulating and animating a plot of multiple functions, I'm unable to generate a legend for the second and subsequent functions in my list. I've narrowed down the problem to the use of ReplaceAll(/.).
Here is a simplified demo:
- The first
Plot[]does not contain a/.and behaves correctly: Each function gets its own color and legend. - The second
Plot[]contains a/.and plots all functions with the same color and only the first function gets a legend. - The third
Plot[]adds anEvaluated -> Truedirective, which fixes the color but not the legend issue.
Plot[{x, x^2, x^3}, {x, -1, 1}, PlotLegends -> {"n=1", "n=2", "n=3"}]
Plot[{x, x^2, x^3} /. {}, {x, -1, 1}, PlotLegends -> {"n=1", "n=2", "n=3"}]
Plot[{x, x^2, x^3} /. {}, {x, -1, 1}, Evaluated -> True, PlotLegends -> {"n=1", "n=2", "n=3"}]
In my actual code, I make use of the ReplaceAll directive to expose parameters to Manipulate[] so I'd like to learn how to get legends to work with /..
I'm new to Mathematica and, from what I could tell after extensive searching on MMA.SE, the Evaluate -> True directive ought to have been enough to get Plot[] to treat its input as a true list and map each list item to a separate legend text. Clearly I'm missing some nuance. Any help would be appreciated!

