Jay,
here one can use the concept of "pure functions":
ff[x_, t_, z_] := x^3/t + z;
myPlot[ff[#, 3, 7] &, x, -2, 2]
or directly
myPlot[#^3 &, x, -2, 2]
As a remark: In your function myPlot
the definition of var
is not really necessary as it is simply a dummy variable. One way would be using a local variable, another way is to use "formal parameters", e.g.:
myPlot[f_, a_, b_] := Manipulate[Show[Plot[f[\[FormalX]], {\[FormalX], a, b}],
Graphics[{PointSize[.02], Point[{pnt, f[pnt]}, VertexColors -> Red]}]], {pnt, a, b}]
Edit: ... or no specific variable definition at all as this variable is local to Plot
.
Does that help? Regards -- Henrik