Compute fixed heatmap device size
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
npcunits.- 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
npcunits.- units
Output unit string passed to grid conversion helpers, such as
"in","cm", or"mm".- ht_list
A
ComplexHeatmap::HeatmaporComplexHeatmap::HeatmapListobject.- legend_list
A list of
ComplexHeatmap::Legendobjects.
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
#> $ht_width
#> [1] 6.33333333333333inches
#>
#> $ht_height
#> [1] 6.33333333333333inches
#>