Suppose I want to plot a function $f(x,y)$ but first need to calculate its symbolic expression. An easy solution is to copy the output of my calculation by hand and then paste into Plot
function. If I naively do this
f[x_,y_]:= 100*x^3+Tanh[y^2];
Plot3D[f[x,y],{x,-10,10},{y, -20, 20}]
then it runs very slowly (for a much more complicated function I'm plotting). I think what's happenning is that instead of symbolically calcualte f[x,y]
, Mathematica numerically calculates it.
Question: is there a way to delay Plot
first and evaluate the function inside Plot
? Maybe using Hold
? But I don't see how I can evaluate the function first after holding.
f[x_,y_] = 100*x^3+Tanh[y^2]
instead off[x_,y_] := 100*x^3+Tanh[y^2]
? Either that, or make aTable
of values instead and useListPlot3D
. $\endgroup$Evaluated->True
insidePlot3D
$\endgroup$