plot_EM_embedding2D.RdPlot an \(n \times 2\) embedding (e.g., two selected dimensions, PCA/t-SNE/UMAP)
and overlay the Smooth-EM component means (mu_list) as points connected by arrows.
Optionally color observations by a continuous vector (e.g., a Fiedler vector).
plot_EM_embedding2D(
mu_list,
X2,
t_vec = NULL,
mu_order = NULL,
pch = 19,
col = "grey60",
cex = 0.7,
mu_pch = 8,
mu_col = "orange",
mu_cex = 1,
arrow_col = "orange",
arrow_lwd = 2.5,
arrow_len = 0.08,
add = FALSE,
xlab = NULL,
ylab = NULL,
main = NULL,
add_legend = !is.null(t_vec),
legend_title = "t",
pal = (grDevices::colorRampPalette(c("#2b8cbe", "white", "#de2d26")))(256),
...
)A length-\(K\) list of mean vectors. Each element should be a numeric vector
of length at least 2, where the first two entries correspond to the coordinates in X2.
Numeric matrix of dimension \(n \times 2\) giving the embedding coordinates for observations.
Optional numeric vector of length \(n\). If provided, points are colored by t_vec
using pal.
Optional integer permutation of 1:K specifying the plotting order of components.
Defaults to 1:K.
Observation color used when t_vec is NULL.
Point size for observations.
Point character for component means.
Color for component means.
Point size for component means.
Color for arrows connecting consecutive component means.
Line width for arrows.
Arrow head length (see arrows).
Logical; if TRUE, add to an existing plot. If FALSE, create a new plot.
Axis labels. If NULL, defaults to "dim 1" and "dim 2".
Plot title. If NULL, uses a default title.
Logical; if TRUE and t_vec is provided, add a small legend (quantile ticks).
Title for the legend when t_vec is provided.
A vector of colors used to map t_vec to point colors. Defaults to a blue-white-red palette.
Additional arguments passed to plot when add = FALSE.
An invisible list with elements:
X2: the embedding coordinates used for plotting.
mu: the \(K \times 2\) matrix of plotted component means (after mu_order).
mu_order: the component order used.