make_pca_plot(pca_object, correlation_data, ...)

PCA correlation plot with 2D density legend (axes 1–2).

visualisation
Args:pca_object — PCA resultcorrelation_data — loadingsmultAx1/multAx — scalingtitle — plot title
make_pca_plot <- function(pca_object, correlation_data, multAx1, multAx, title) {
  legend_text <- paste0(
    "Space occupied by:\n",
    "50% = ", round(pca_object$ALLDensity[1, "0.5"], 2), "\n",
    "99% = ", round(pca_object$ALLDensity[1, "0.99"], 2)
  )
  PCA_plot(pca_object$PCoA, correlation_data, multAx1, multAx, title, legend_text)
}