annotation_block_fill_graphics: Build block fill panel function

View source: R/heatmap.R

annotation_block_fill_graphicsR Documentation

Build block fill panel function

Description

Build block fill panel function

Usage

annotation_block_fill_graphics(
  levels,
  palette = NULL,
  palcolor = NULL,
  fill_values = NULL,
  border = FALSE
)

Arguments

levels

Character/factor levels used as keys for fill mapping.

palette

Palette name. All available palette names can be queried with show_palettes.

palcolor

Custom colors used to create a color palette.

fill_values

Optional named fill vector. Names should match levels.

border

Whether to draw block border.

Value

A function with signature ⁠(index, levels)⁠ suitable for panel_fun in ComplexHeatmap::anno_block.

Examples

library(ggplot2)
lv <- c("A", "B", "C")
panel_fun <- annotation_block_fill_graphics(
  levels = lv,
  fill_values = c(A = "#1b9e77", B = "#d95f02", C = "#7570b3")
)
ComplexHeatmap::anno_block(panel_fun = panel_fun)

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