View source: R/plot_local_models.R
| vc_plot_tangent | R Documentation |
Display the approximation and its sensitivity status. A plotted line does not certify that the mathematical tangent exists.
vc_plot_tangent(
result,
f,
xlim = NULL,
n = 401L,
colors = c(curve = "#24476b", line = "#c44736", point = "#222222", differential =
"#188367", change = "#8250a3"),
title = NULL,
xlab = "x",
ylab = "y"
)
result |
Plain result list from the corresponding calculation function. |
f |
The same deterministic scalar function used for the calculation. Function values at the stored anchor points must match the result. |
xlim |
Optional increasing pair of finite real plot limits, containing the anchor points. NULL derives limits around the anchors. |
n |
Integer number of curve samples, at least 2. The curve is a sampled visualization, not an exact representation or a continuity test. |
colors |
Named character vector with entries curve, line, point, differential, and change; values are Plotly/CSS colors. |
title |
Optional scalar plot title. NULL uses a descriptive default. |
xlab, ylab |
Scalar axis labels. |
All sampling limitations of vc_plot_secant() apply. The legend identifies an approximate tangent and the subtitle reports numerical sensitivity status. One-sided methods are identified explicitly.
An interactive plotly htmlwidget with function, line and anchor.
if (requireNamespace("plotly", quietly = TRUE)) {
vc_tangent(sin, 0) |> vc_plot_tangent(f = sin)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.