Plots Morse-Smale cells defined by separatrices using filled polygons. This function visualizes the decomposition of the domain into cells based on gradient flow separatrices emanating from saddle points.
Usage
separatrices.with.cells.plot(
separatrices,
M1.pos,
M2.pos,
saddle_pos,
add = TRUE,
cell_colors = list(M1_m1 = rgb(0, 0.5, 0, alpha = 0.1), M1_m2 = rgb(1, 1, 0, alpha =
0.1), M1_m3 = rgb(1, 0, 0, alpha = 0.1), M2_m2 = rgb(0, 0, 1, alpha = 0.1), M2_m3 =
rgb(0.6, 0, 1, alpha = 0.1), M2_m4 = rgb(0, 1, 1, alpha = 0.1)),
...
)Arguments
- separatrices
List of separatrix trajectories containing:
boundary_left: Boundary critical point on left edge
boundary_right: Boundary critical point on right edge
boundary_top: Boundary critical point on top edge
boundary_bottom: Boundary critical point on bottom edge
saddle_ascending1: First ascending trajectory from saddle
saddle_ascending2: Second ascending trajectory from saddle
saddle_descending1: First descending trajectory from saddle
saddle_descending2: Second descending trajectory from saddle
- M1.pos
Position of first maximum as c(x, y)
- M2.pos
Position of second maximum as c(x, y)
- saddle_pos
Position of saddle point as c(x, y)
- add
Logical, whether to add to existing plot (default TRUE)
- cell_colors
List of colors for each cell with names:
M1_m1: Cell connecting M1 to minimum m1
M1_m2: Cell connecting M1 to minimum m2
M1_m3: Cell connecting M1 to minimum m3
M2_m2: Cell connecting M2 to minimum m2
M2_m3: Cell connecting M2 to minimum m3
M2_m4: Cell connecting M2 to minimum m4
- ...
Additional arguments passed to plot if add = FALSE
Examples
if (FALSE) { # \dontrun{
# Typically used with pre-computed separatrices
# Example with a simple two-maximum system
separatrices <- list(
boundary_left = c(0, 0.5),
boundary_right = c(1, 0.5),
boundary_top = c(0.5, 1),
boundary_bottom = c(0.5, 0),
saddle_descending1 = matrix(c(0.5, 0.5, 0.3, 0.3), nrow = 2, byrow = TRUE),
saddle_descending2 = matrix(c(0.5, 0.5, 0.7, 0.7), nrow = 2, byrow = TRUE)
)
separatrices.with.cells.plot(separatrices,
M1.pos = c(0.3, 0.7),
M2.pos = c(0.7, 0.3),
saddle_pos = c(0.5, 0.5))
} # }