As you mentioned that you wanted a GUI using Button
DynamicModule[{b = {True, True, True}, res,
funs = {0.5 x + 1, x, 2 x - 2}, pic},
fun[val_] := If[val == True, "Pressed", "DialogBox"];
res = Dynamic@
Row@{Button["f(x)", If[b[[1]] == True, b[[1]] = False, b[[1]] = True],
BaseStyle -> {"GenericButton", 20, Bold}, Appearance->fun[b[[1]]]],
Button["y(x)", If[b[[2]] == True, b[[2]] = False, b[[2]] = True],
BaseStyle -> {"GenericButton", 20, Bold},Appearance->fun[b[[2]]]],
Button["g(x)", If[b[[3]] == True, b[[3]] = False, b[[3]] = True],
BaseStyle -> {"GenericButton", 20, Bold},Appearance->fun[b[[3]]]]
};
pic = Column[{res,Dynamic@Plot[
Evaluate@Flatten@MapThread[If[#1 == True, #2, Null] &,{b,funs}],
{x, -1, 5},PlotRange -> {-1, 5}, AspectRatio ->1,PlotStyle->Thick,
Epilog -> {Text[If[b[[1]] == True, "f(x)", ""], {4.5, 2.7}],
Text[If[b[[2]] == True, "y=x", ""], {4.5, 4}],
Text[If[b[[3]] == True, "g(x)", ""], {3, 4.5}]},
ImageSize -> 500]},
Alignment -> Center, Frame -> True, Background -> {{LightRed, None}}
];
pic
]
Read the FAQs
! 3) When you see good Q&A, vote them up byclicking the gray triangles
, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem,by clicking the checkmark sign
` $\endgroup$