plot_heatmap: plot_heatmap

View source: R/plot_heatmap.R

plot_heatmapR Documentation

plot_heatmap

Description

Generate a heatmap for a given correlation matrix.

Usage

plot_heatmap(
  cor_mat,
  scale = "none",
  show_rownames = FALSE,
  show_colnames = FALSE,
  labels_row = NULL,
  labels_col = NULL,
  breaks = seq(-1, 1, length.out = 101),
  legend_breaks = c(-1, -0.5, 0, 0.5, 1),
  legend_labels = c("-1.0", "-0.5", "0", "0.5", "1.0"),
  legend_name = "Correlation",
  output_path = NULL,
  display = TRUE,
  render_as = "png",
  width = 18,
  height = 16,
  dpi = 600
)

Arguments

cor_mat

A numeric matrix representing the correlation values.

scale

Character string indicating how to scale the data. Default is 'none'.

show_rownames

Logical indicating whether to show row names. Default is FALSE.

show_colnames

Logical indicating whether to show column names. Default is FALSE.

labels_row

Character vector of labels for the rows. Default is NULL.

labels_col

Character vector of labels for the columns. Default is NULL.

breaks

Numeric vector of breakpoints for the heatmap colors. Default is seq(-1, 1, length.out = 101).

legend_breaks

Numeric vector of breakpoints for the legend. Default is c(-1, -0.5, 0, 0.5, 1).

legend_labels

Character vector of labels for the legend. Default is c("-1.0", "-0.5", "0", "0.5", "1.0").

legend_name

Character string for the legend title. Default is 'Correlation'.

output_path

Character string for the output file path. Default is NULL.

display

Logical indicating whether to display the plot. Default is TRUE.

render_as

Character string indicating the file format to save the plot. Default is 'png'.

width

Numeric indicating the width of the plot. Default is 18.

height

Numeric indicating the height of the plot. Default is 16.

dpi

Numeric indicating the resolution of the plot. Default is 600.

Details

This function generates a heatmap for a given correlation matrix.

Value

A heatmap plot.

Author(s)

Zhen Lu luzh29@mail2.sysu.edu.cn


omixVizR documentation built on Nov. 5, 2025, 7:23 p.m.