Skip to contents

Adds labeled line segments to a 3D plot at positions of local extrema

Usage

label.extrema.3d(
  graph.3d,
  extrema.df,
  extrema.type = c("both", "maxima", "minima"),
  offset = c(0, 0, 0.25),
  with.labels = TRUE,
  lab.cex = 1.5,
  lab.adj = c(0, 0),
  C = -1,
  pwd = 5,
  separate.colors = TRUE,
  col.max = "red",
  col.min = "blue",
  col = "black",
  ...
)

Arguments

graph.3d

A matrix with 3 columns representing 3D coordinates

extrema.df

Data frame with columns: vertex, label, and either is_max (0/1) or type ("min"/"max")

extrema.type

Character string specifying which extrema to plot: "both" (default), "maxima", or "minima".

offset

Numeric vector of length 3 specifying the offset for line segments. Default c(0, 0, 0.25).

with.labels

Logical. Whether to show labels. Default TRUE.

lab.cex

Character expansion factor for labels. Default 1.5.

lab.adj

Adjustment parameter for label positioning. Default c(0, 0).

C

Scaling factor for label position relative to stick center. Default -1.

pwd

Line width for segments. Default 5.

separate.colors

Logical. If TRUE and extrema.type="both", plot maxima and minima with different colors. Default TRUE.

col.max

Color for maxima. Default "red".

col.min

Color for minima. Default "blue".

col

Color for all extrema when separate.colors=FALSE. Default "black".

...

Additional arguments passed to bin.segments3d().

Value

Invisibly returns NULL.

Examples

if (FALSE) { # \dontrun{
# Plot both maxima and minima with different colors
label.extrema.3d(graph.3d, extrema.df)

# Plot only maxima
label.extrema.3d(graph.3d, extrema.df, extrema.type = "maxima")

# Plot only minima
label.extrema.3d(graph.3d, extrema.df, extrema.type = "minima")

# Plot both with same color
label.extrema.3d(graph.3d, extrema.df, separate.colors = FALSE, col = "purple")
} # }