View source: R/Plotmat_function.R
plotmat | R Documentation |
This function plots a matrix with specified settings, creating an image file.
plotmat(
mat_m,
n_colors = 256,
lab_col = NULL,
is_cor = FALSE,
folder = "~/Desktop/",
filename = "prova"
)
mat_m |
Matrix. The matrix to be plotted. |
n_colors |
Integer. The number of colors to use in the plot. Default is 256. |
lab_col |
Character. Optional label for the color legend. Default is NULL. |
is_cor |
Logical. If TRUE, the matrix is treated as a correlation matrix with values ranging from -1 to 1. Default is FALSE. |
folder |
Character. The folder to save the plot file. Default is '~/Desktop/'. |
filename |
Character. The filename for the plot file (without extension). Default is 'prova'. |
None. The function saves the plot as a PNG file.
# Example matrix
mat <- matrix(runif(100), nrow = 10)
# Plot the matrix
plotmat(mat, n_colors = 256, lab_col = "Intensity", is_cor = FALSE, folder = tempdir(), filename = "matrix_plot")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.