View source: R/plot_multivariable.R
| vc_plot_directional | R Documentation |
Plot a directional line restriction on a sampled scalar surface
vc_plot_directional(
result,
f,
xlim = NULL,
ylim = NULL,
t_range = c(-1, 1),
n = 61L,
colors = c(surface = "#24476b", curve = "#188367", tangent = "#c44736", point =
"#222222"),
alpha = 0.45,
line_width = 3,
title = NULL,
scene = list(aspectmode = "data")
)
result |
Two-dimensional vc_directional() result. |
f |
Deterministic scalar field accepting ONE numeric vector and returning
one finite real scalar. For f(x,y), supply an explicit wrapper
|
xlim, ylim |
Optional finite increasing surface bounds covering the point. NULL uses point plus/minus two; t_range controls the separate curve. |
t_range |
Finite increasing line-parameter bounds containing zero. |
n |
Integer number of contour samples per coordinate, at least two. |
colors |
Named surface, curve, tangent and point Plotly/CSS colors. |
alpha |
Finite contour opacity between zero and one. |
line_width |
Positive finite vector line width. |
title |
Optional scalar title; default reports numerical sensitivity. |
scene |
Plotly scene list for the three-dimensional vector view. |
Recovers the directional curve/surface idea of legacy directional_derivative3d. Curve height is sampled f(point+t*u), whereas the tangent height uses only the stored derivative estimate. The direction is a unit domain vector, so the parameter is domain distance. Failed diagnostics and one-sided methods are explicitly labeled. Missing samples are gaps, not proof that no intervening singularity exists.
Plotly 3D surface with the actual line-restriction curve, numerical tangent through the stored point, and stored base point.
if(requireNamespace("plotly",quietly=TRUE)) {
f <- function(v)v[1]^2+2*v[2]^2
f |> vc_directional(c(1,1),c(1,1)) |> vc_plot_directional(f=f)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.