make.surface {Rlab}R Documentation

Creates a surface

Description

Using the given x and y grid and function (an R function or a quoted function, e.g. "x+y"), a surface is generated.

Usage

make.surface(x, y, FUN, ...)

Arguments

x vector for x coordinates.
y vector for y coordinates.
FUN an R function or a formula in quotes.
... additional arguements for the function.

See Also

contour, image, persp

Examples


# 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)

[Package Rlab version 1.3.1 Index]