I'm trying to create a table of diagrams of which each shows a different variable on the x axis and fetches the remaining parameters from the enclosing scope, a Manipulate object.
So I have this code that creates the expression to be plotted for each plot.
f[a_, b_, c_] := a + b + c
args = {{x, b, c}, {a, x, c}, {a, b, x}}
Manipulate[
Evaluate[f @@ # & /@ args],
{a, 0, 1}, {b, 0, 1}, {c, 0, 1}
]
But then when I go to plot it, it appears to evaluate the expression correctly within the Manipulate
scope but not the Plot
scope
Manipulate[
Evaluate[Plot[Evaluate[f @@ #], {x, 0, 1}, PlotLabel -> f @@ #] & /@ args],
{a, 0, 1}, {b, 0, 1}, {c, 0, 1}
]
I found this post which seems to do what I want, but I can't seem to figure out the idiom behind it or how it differs from my approach. I'm sure this is a scoping issue, but I've tried changing things at pretty much each stage of evaluation, and this seemed closest to being correct in terms of results. Just as much as solving the problem, I'd like to know why this particular implementation isn't working.