# Interactive plot with checklist

I'd need to write an interactive plot. I have some function I defined and some point lists I get from external data file. I'd need to see those data along with my functions, and I know how to do that. However I would also like to have a checklist, and by clicking over each button I should be able to show/hide a function or a data point set.

I don't need the full code, just a hint about how to get a checklist, and how to make it dynamically affect the function I'm plotting would be great!

SeedRandom[42];
{set6, set9} = RandomReal[{-1, 1}, {#, 2}] & /@ {6, 9};
{p6, p9} = Interpolation[#, Method -> "Spline"] & /@ {set6, set9};
With[{in = Indeterminate},
Manipulate[Show[Quiet@
Plot[{If[t6p, p6@x, in], If[t9p, p9@x, in], in}, {x, -1, 1}, PlotRange -> {{-1, 1}, 5 {-1, 1}}],
ListPlot[{If[t6s, set6, in], If[t9s, set9, in], in}, PlotStyle -> PointSize[Large]]],
Grid[{{Control[{t6s, {True, False}}], Spacer[10], Control[{t6p, {True, False}}]},
{Control[{t9s, {True, False}}], Spacer[10], Control[{t9p, {True, False}}]}}]]]


• "just a hint" :) Dec 27, 2013 at 17:23
• @cormullion It may seem simple for an experienced user, but there are a lot of possible pitfalls in that code for a novice. I preferred to post a small working example than to elaborate on the caveats. Do you think it's out of place? Dec 27, 2013 at 17:27
• No not at all! :) The great thing about this site is how you experts give so much more than the minimum necessary... Dec 27, 2013 at 18:50