curve3d | R Documentation |
Two-dimensional analogue of curve
: generates a surface
and plots it
curve3d(expr, from = c(0, 0), to = c(1, 1), n = c(41, 41),
xlim, ylim, add = FALSE,
xlab=varnames[1],
ylab=varnames[2],
zlab = NULL, log = NULL, sys3d = c("persp", "wireframe", "rgl",
"contour", "image", "none"),
varnames=c("x","y"),use_plyr=TRUE,.progress="none",...)
expr |
a mathematical expression using |
from |
minimum values for |
to |
maximum values for |
xlim |
range of values for |
ylim |
range of values for |
n |
number of grid points in each direction |
add |
(logical) add to an existing plot? (only possible for contour plots or rgl) |
xlab |
x label |
ylab |
y label |
zlab |
z label |
log |
(character): |
sys3d |
3D plotting system to use: one of
|
varnames |
names of variables to substitute |
use_plyr |
use methods from the |
.progress |
progress bar type ( |
... |
additional arguments to the plotting functions |
invisibly, a list of
x |
x values |
y |
y values |
z |
z matrix |
You must explicitly install the rgl
package
(via install.packages("rgl")
) before using
sys3d="persp"
.
if you encounter the error ‘Results must have one or
more dimensions’, try use_plyr=FALSE
or use c()
to remove attributes from the result of your expression
outer
, curve
curve3d(cos(2*pi*x)+sin(2*pi*y/3),
from=c(0,0),to=c(1,1))
x <- 1
y <- 3
curve3d(cos(2*pi*x)+sin(2*pi*y/3),
from=c(0,0),to=c(1,1),sys3d="wireframe")
curve3d(x*cos(2*pi*a/x)+sin(2*pi*b/y),
from=c(0,0),to=c(1,1),sys3d="wireframe",
varnames=c("a","b")) ## identical
op <- par(mfrow=c(2,2))
curve3d(cos(2*pi*x)+sin(2*pi*y/3),
from=c(0,0),to=c(1,1),sys3d="image")
curve3d(x*cos(2*pi*a/x)+sin(2*pi*b/y),
from=c(0,0),to=c(1,1),sys3d="image",
varnames=c("a","b")) ## identical
x <- 4
curve3d(cos(2*pi*a/x)+y*sin(2*pi*b/y),
from=c(0,0),to=c(1,1),sys3d="image",
varnames=c("a","b"))
curve3d(cos(2*pi*x)+sin(2*pi*y/3),
from=c(0,0),to=c(1,1),sys3d="image")
curve3d(cos(2*pi*x)+sin(2*pi*y/3),
sys3d="contour",add=TRUE)
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.