plot_function_surface | R Documentation |
A (filled) contour plot or perspective plot of a function, interactive via plotly.
plot_function_surface( f = function(x) { rowSums(x^2) }, lower = c(0, 0), upper = c(1, 1), type = "filled.contour", s = 100, xlab = "x1", ylab = "x2", zlab = "y", color.palette = terrain.colors, title = " ", levels = NULL, points1, points2, pch1 = 20, pch2 = 8, lwd1 = 1, lwd2 = 1, cex1 = 1, cex2 = 1, col1 = "blue", col2 = "red", ... )
f |
function to be plotted. The function should either be able to take two vectors or one matrix specifying sample locations. i.e. |
lower |
boundary for x1 and x2 (defaults to |
upper |
boundary (defaults to |
type |
string describing the type of the plot: |
s |
number of samples along each dimension. e.g. |
xlab |
lable of first axis |
ylab |
lable of second axis |
zlab |
lable of third axis |
color.palette |
colors used, default is |
title |
of the plot |
levels |
number of levels for the plotted function value. Will be set automatically with default NULL.. (contour plots only) |
points1 |
can be omitted, but if given the points in this matrix are added to the plot in form of dots. Contour plots and persp3d only. Contour plots expect matrix with two columns for coordinates. 3Dperspective expects matrix with three columns, third column giving the corresponding observed value of the plotted function. |
points2 |
can be omitted, but if given the points in this matrix are added to the plot in form of crosses. Contour plots and persp3d only. Contour plots expect matrix with two columns for coordinates. 3Dperspective expects matrix with three columns, third column giving the corresponding observed value of the plotted function. |
pch1 |
pch (symbol) setting for points1 (default: 20). (contour plots only) |
pch2 |
pch (symbol) setting for points2 (default: 8). (contour plots only) |
lwd1 |
line width for points1 (default: 1). (contour plots only) |
lwd2 |
line width for points2 (default: 1). (contour plots only) |
cex1 |
cex for points1 (default: 1). (contour plots only) |
cex2 |
cex for points2 (default: 1). (contour plots only) |
col1 |
color for points1 (default: "black"). (contour plots only) |
col2 |
color for points2 (default: "black"). (contour plots only) |
... |
additional parameters passed to |
plotly visualization (based on plot_ly
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.