Skip to contents

Visualizes the vertices belonging to a specific basin from a basins object in 3D using rgl graphics. Searches for the basin in either local minima or local maxima basins and draws the constituent vertices as spheres.

Usage

draw.basin(basins.obj, basin.label, radius = 0.15, col = "cyan")

Arguments

basins.obj

List object containing basin analysis results with structure:

  • basins$lmin_basins: Named list of local minima basins

  • basins$lmax_basins: Named list of local maxima basins

Each basin contains a basin_df data frame where the first column contains vertex indices.

basin.label

Character string identifying the basin to draw. Must match a name in either lmin_basins or lmax_basins

radius

Numeric radius for basin vertex spheres. Default is 0.15

col

Character string specifying color for basin spheres. Default is "cyan"

Value

None. Function is called for its side effect of adding 3D graphics to the current rgl device.

Details

The function expects a global graph.3d object containing 3D coordinates for graph vertices. It searches for basin.label first in local minima basins, then in local maxima basins. If the basin is not found in either, an error is thrown.

Examples

if (FALSE) { # \dontrun{
# Assumes graph.3d and final.basins are defined
draw.basin(final.basins, "M1", radius = 0.2, col = "cyan")
} # }