I tried to write a convenience wrapper around Manipulate
for easier plotting. However I failed already at the very first step.
Consider the following example:
manipulatePlot[fun_, ran_, manran_] :=
DynamicModule[{f = fun, r = ran, manr = manran},
Manipulate[Plot[Evaluate[f], Evaluate[r]], Evaluate[manr]]
]
g[x_, a_] := a x^2
manipulatePlot[g[x, a], {x, 0, 2}, {a, 0, 2}]
The result is an empty plot... How do I get the plot displayed properly?
The problem must be with the Plot
function, because the following does work (i.e. a
can be correctly manipulated):
manipulate[fun_, manran_] :=
DynamicModule[{f = fun, manr = manran},
Manipulate[Evaluate[f], Evaluate[manr]]
]
manipulate[g[x, a], {a, 0, 2}]
```