Hello, I am developing an application and in that application I am giving an option to user to ploy some functions or not. I do that through a checkbox. It is working fine but when the value of the checkbox is False there is "Null" statement where the figure might have been. Is there a way to avoid that? Thank you.
Manipulate[
DynamicModule[{f = Sin[x], xR = 1, xL = 0,
Res = 0.4596976941318603`16, fp = False},
Column[{Style["1D Definite Integral Calculator", "Function"],
Row[{"Lower Limit ", InputField[Dynamic[xL], Number]}, Spacer[5]],
Row[{"Upper Limit ", InputField[Dynamic[xR], Number]},
Spacer[5]],
Row[{"Function ", InputField[Dynamic[f]]}, Spacer[20]],
Button[Style["Calculate", Green, Bold],
Dynamic[Res = DGL[f, xR, xL, np, nw];]],
Row[{"Result", InputField[Dynamic[Res], Enabled -> False]},
Spacer[51]],
Row[{"Plot the Function ", Checkbox[Dynamic[fp], {False, True}]}],
Dynamic[
If[fp == True,
InputField[
Dynamic[Plot[f, {x, xL, xR}, Dynamic[PlotLabel -> f],
ImageSize -> Full]], FieldSize -> {30, 15}]]]
}]], {{np, 16, "NumberFormat"},
ControlPlacement -> Bottom}, {{nw, 16, "WorkingPrecision"},
ControlPlacement -> Bottom},
Initialization :> (DGL[f_, xR_, xL_, np_, nw_] := Module[{},
ResultTF =
SetPrecision[
NIntegrate[f, {x, xL, xR},
WorkingPrecision -> Re[IntegerPart[nw]]],
Re[IntegerPart[np]]]])]