heatmap_fixsize: Compute fixed heatmap device size

View source: R/heatmap.R

heatmap_fixsizeR Documentation

Compute fixed heatmap device size

Description

Compute fixed heatmap device size

Usage

heatmap_fixsize(
  width,
  width_sum,
  height,
  height_sum,
  units,
  ht_list,
  legend_list
)

Arguments

width

Optional user-provided target width. If NULL, width is estimated from the drawn heatmap layout.

width_sum

Numeric baseline width used when heatmap body size is in npc units.

height

Optional user-provided target height. If NULL, height is estimated from the drawn heatmap layout.

height_sum

Numeric baseline height used when heatmap body size is in npc units.

units

Output unit string passed to grid conversion helpers, such as "in", "cm", or "mm".

ht_list

A ComplexHeatmap::Heatmap or ComplexHeatmap::HeatmapList object.

legend_list

A list of ComplexHeatmap::Legend objects.

Value

A list with two converted units: ht_width and ht_height.

Examples

mat <- matrix(rnorm(100), nrow = 10)
ht <- ComplexHeatmap::Heatmap(mat, name = "expr")
lgd <- list(ComplexHeatmap::Legend(title = "expr", at = c(-2, 0, 2)))
out <- heatmap_fixsize(
  width = NULL,
  width_sum = 6,
  height = NULL,
  height_sum = 4,
  units = "in",
  ht_list = ht,
  legend_list = lgd
)
out

thisplot documentation built on March 7, 2026, 5:07 p.m.