Skip to contents

Render a neurosurf plot using rgl

Usage

render_surface_plot(x, offscreen = TRUE, scale = c(2, 2), crop = TRUE)

Arguments

x

A "neurosurf_plot" object.

offscreen

Logical; if TRUE, rendering is performed with rgl.useNULL = TRUE so that plots can be captured as images. A real GL context is attempted first for better antialiasing.

scale

Numeric vector of length 2 giving a supersampling factor for the offscreen snapshot. Values above 1 render at higher resolution before downscaling for smoother edges. Defaults to c(2, 2).

crop

Logical; if TRUE, automatically crops away white/empty margins from each snapshot to avoid the "tiny brain" effect in grids.

Value

A list containing rendered panel images (with aspect ratios) and layout information. This is a low-level helper intended to be wrapped by higher-level figure drawing utilities.

Examples

# \donttest{
geom <- example_surface_geometry()
p <- surface_plot(geom)
rendered <- render_surface_plot(p)
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: no non-missing arguments to max; returning -Inf
# }