I would like to create a list of parameters, then create a Manipulate
with these parameters. Similar to this piece of code:
(* code that generates manipulate parameters *)
bars = Array[b, 5];
(* code that generates manipulate *)
Manipulate[
BarChart[bars, PlotRange -> {0, 2}],
Evaluate[Sequence @@ ({#, 0, 2} & /@ bars)]]
Manipulate
displays 5 controls for b[1]
..b[5]
, but the BarChart
always stays empty - I think bars
isn't evaluated, but I couldn't figure out how to make Manipulate
evaluate it.
This works, but isn't dynamic any more:
bars = Array[b, 5];
Manipulate[
BarChart[{b[1], b[2], b[3], b[4], b[5]}, PlotRange -> {0, 2}],
Evaluate[Sequence @@ ({#, 0, 2} & /@ bars)]]
(i.e. if the code above decides to create 4 or 6 entries in bars
it won't work any more)
With[{bars = bars}, Manipulate[BarChart[bars, PlotRange -> {0, 2}], Evaluate[Sequence @@ ({#, 0, 2} & /@ bars)]] ]
? $\endgroup$