Hello Wu,
Plot
has the attribute HoldAll
, so you have to make sure that any necessary evaluation inside gets done, using Evaluate[]
:
f = {1, x, x^2, x^3}
Panel[Column[{Row[{CheckboxBar[
Dynamic[list1], # -> f[[#]] & /@ Range[4]], Dynamic[list1]}],
Dynamic[Plot[Evaluate@f[[list1]], {x, 0, 1.5},
PlotStyle -> {Red, Blue, Green, Black}, ImageSize -> 500,
AxesStyle -> Thick]]}]]
Regards -- Henrik