Fits are computed explicitly before drawing. Supply predictions from any
model on a rectangular grid; fitted R objects and callbacks are not stored
in the drawing. The prediction grid may extend the original axis ranges.
Add surfaces before composing drawings with draw_panels().
Usage
draw_add_surface(
plot,
x = NULL,
y = NULL,
z = NULL,
name = "Surface",
color = "#6ca3a0",
opacity = 0.35,
layer = NULL,
expand = TRUE
)Arguments
- plot
htmlwidget: Existing Cartesian ECharts-GL drawing.
- x, y
Numeric: Finite, distinct grid coordinates, at least two per axis.
- z
Numeric matrix: Predictions, with x along rows and y along columns. NA removes adjacent cells. At least one complete grid cell is required.
- name
Character: Legend label; matching names link legend selection.
- color
Character: Surface fill color.
- opacity
Numeric
[0, 1]: Surface opacity.- layer
Optional SurfaceLayer: Complete geometry, supplied alone.
- expand
Logical: Extend axis ranges to include surface coordinates. When false, all finite surface coordinates must already lie within them.