This function plots the matrix of cosine similarities (AKA "Similarity Matrix") as a heatmap and saves it as a JPEG file. It also calculates and displays the mixing matrix condition number (AKA "Complexity Index") of the matrix.
cosine.similarity.plot(
spectra,
filename = "autospectral_similarity_matrix",
title = NULL,
output.dir = "figure_similarity_heatmap",
figure.width = 8,
figure.height = 6,
color.palette = "viridis",
show.legend = TRUE,
save = TRUE
)Data frame or matrix containing spectral data.
Character string for the output file. Default is
autospectral_similarity_matrix.
Optional prefix for the plot filename. Default is NULL
File path where the plot will be created. Default is
figure_similarity_heatmap. The directory will be created if it does not
already exist.
Numeric. Width of output plot. Default is 8.
Numeric. Height of output plot. Default is 6.
Optional character string defining the viridis color
palette to be used for the fluorophore traces. Default is viridis. Options
are the viridis color options: magma, inferno, plasma, viridis,
cividis, rocket, mako and turbo.
Logical. If TRUE, figure legend will be included.
Logical, if TRUE, saves a JPEG file to the output.dir.
Otherwise, the plot will simply be created in the Viewer.
Saves the heatmap plot as a JPEG file in the similarity directory.