Skip to contents

This function takes a fitted MFA model (e.g., from mfa_em_fit()) and produces a faceted heatmap or bar plot of each cluster's factor loadings.

Usage

plot_cluster_synergy_loadings_mfa(
  mfa_fit,
  cluster_ids = NULL,
  plot_type = c("heatmap", "bar"),
  muscle_names = NULL
)

Arguments

mfa_fit

A fitted MFA model object containing Lambda, z, etc.

cluster_ids

A numeric vector of cluster IDs to plot. Defaults to all.

plot_type

One of "heatmap" or "bar". Specifies how to visualize.

muscle_names

Optional character vector of muscle names for y-axis labels. If NULL, default channel names will be used.

Value

A ggplot object (which you can print or further modify).

Examples

if (FALSE) { # \dontrun{
  # Suppose we have a best MFA model in 'best_mfa_model'
  p <- plot_cluster_synergy_loadings_mfa(best_mfa_model, cluster_ids = 1:2)
  print(p)
} # }