make.surface {Rlab} | R Documentation |
Using the given x and y grid and function (an R function or a quoted function, e.g. "x+y"), a surface is generated.
make.surface(x, y, FUN, ...)
x |
vector for x coordinates. |
y |
vector for y coordinates. |
FUN |
an R function or a formula in quotes. |
... |
additional arguements for the function. |
contour, image, persp
# Generate a 2-dim grid seq(-1,1,length=50)->xgrid seq(-1.5,.8,length=50)->ygrid # Create a surface for x^2-y^2 make.surface(xgrid,ygrid,"xgrid**2-ygrid**2")->look # Plot it various ways image(look) contour(look) persp(look,theta=45)