plotmat: Plot a Matrix with Specified Settings

View source: R/Plotmat_function.R

plotmatR Documentation

Plot a Matrix with Specified Settings

Description

This function plots a matrix with specified settings, creating an image file.

Usage

plotmat(
  mat_m,
  n_colors = 256,
  lab_col = NULL,
  is_cor = FALSE,
  folder = "~/Desktop/",
  filename = "prova"
)

Arguments

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'.

Value

None. The function saves the plot as a PNG file.

Examples

# 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")

himelmallick/MimESys documentation built on April 13, 2025, 9:06 p.m.