| vc_plot_taylor | R Documentation |
Show the sampled function and polynomial above a signed/absolute error panel. Hover reports distance from the expansion point; zoom, pan and the horizontal range slider explore behavior away from that point.
vc_plot_taylor(
result,
f,
xlim = NULL,
n = 401L,
colors = c(curve = "#24476b", polynomial = "#c44736", error = "#188367", point =
"#222222"),
title = NULL,
xlab = "x",
ylab = "y"
)
result |
Plain result from vc_taylor(). |
f |
The same deterministic scalar function used for the calculation. Function values at the stored anchor points must match the result. |
xlim |
Optional increasing finite pair containing the expansion point. NULL uses the range of result$comparison$x together with x0, padded by ten percent; without a nonzero comparison range it uses x0 +/- 1. |
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 curve, polynomial, error and point entries specifying Plotly/CSS colors. |
title |
Optional scalar plot title. NULL uses a descriptive default. |
xlab, ylab |
Scalar axis labels. |
Error means the sampled difference f(x)-P(x), not a rigorous Taylor remainder bound. Undefined/erroring/nonfinite function samples create gaps and NA errors. Warnings during sampling are suppressed. Polynomial overflow also creates gaps; at least one polynomial sample must be finite. A grid can miss singularities or oscillations. The subtitle displays diagnostic status and the number of evaluable errors.
A plotly htmlwidget with function, polynomial, expansion point, signed error and absolute error traces. Derivatives are not recalculated.
if (requireNamespace("plotly", quietly = TRUE)) {
exp |> vc_taylor(x0 = 0, x = seq(-1,1,length.out=21)) |>
vc_plot_taylor(f = exp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.