Another way. ParametricPlot
seems to take apart the list of styles passed via PlotStyle
, and wrapping each style in Dynamic
caused messages and a red-faced plot. So I resort to this hack of putting a special value in as a style, which has to be a valid directive, and replacing it with a Dynamic
style.
sol = Solve[2 x + 2 x^2 - 3 x^3 + 26 x^4 + 32 x^5 + 21 x^6 - 18 x^7 == r, {x}];
lolAux[r_] = x /. sol;
curves = Table[{r, lolAux[r][[i]] // Re, lolAux[r][[i]] // Im}, {i, 1, Length[sol]}];
Manipulate[
With[{plot = ParametricPlot3D[curves, {r, -5, 5},
BoxRatios -> {1, 1, 1},
PlotStyle -> Table[Hue[i/Length@curves], {i, Length@curves}]]},
plot /.
Hue[i_] :>
Dynamic @ Directive[ColorData[1][i Length@curves],
If[MemberQ[highlight, i Length@curves], Thick, Thin]]
],
{{highlight, {}},
Thread[# -> Column[{#, Graphics[{}, Background -> ColorData[1][#], ImageSize -> 16]}]] & /@
Range@Length@curves, TogglerBar}
]
