restart:
with(Maplets): with(Maplets[Tools]): with(Maplets[Elements]): with(plots):
StartEngine();
PlotIt:=Maplet(onstartup = RunWindow(MAIN),
Window[MAIN]('title'="Plot It Demo",
[ ["Type in a function of x, and an interval a..b for x."],
["Function:", TextField['func']('width'=25)],
["Interval:", TextField['interv']('width'=25)],
[Button("Plot It", Evaluate('function' = "plotfunc"))],
[Button("Good Bye", Shutdown())]
]
)
):
[Plotter['myplot']('width'=300, 'height'=300)]:
plotfunc:=proc()
local userfunc, userinterv, userpoint, p1;
userfunc:=Get(thismaplet,'func'::'anything'):
userinterv:=Get(thismaplet,'interv'::'range'):
p1:=plot(userfunc, x=userinterv, thickness=5, color=green);
Set('myplot'=p1)
end proc:
Display( PlotIt );