Learn R Programming

rgp (version 0.4-1)

plotFunction3d: Plot a 2D function as a 3D surface

Description

Creates and shows and perspective plot of a 2D function of either the form $z = f(x, y)$ or $z = f(xv)$, where $xv$ is a numeric of length 2.

Usage

plotFunction3d(func = function(x) sum(x^2), lo = c(0, 0), up = c(1, 1), samples = 10, palette = gray.colors(256), ...)

Arguments

func
A 2D function to plot.
lo
A vector of lower limits of the plot (one entry for each dimension).
up
A vector of upper limits of the plot (one entry for each dimension).
samples
The number of samples in each dimension.
palette
The color palette, use NULL to disable.
...
Graphic parameters for persp.