anno_textbox: Text box annotations

View source: R/anno_textbox.R

anno_textboxR Documentation

Text box annotations

Description

Text box annotations

Usage

anno_textbox(align_to, text, background_gp = gpar(fill = "#DDDDDD", col = "#AAAAAA"),
    which = c("row", "column"), by = "anno_link", side = c("right", "left"), ...)

Arguments

align_to

It controls how the text boxes are aligned to the heatmap rows. The value can be a categorical vector which have the same length as heatmap rows, or a list of row indices. It does not necessarily include all row indices.

text

The corresponding texts. The value should be a list of texts. To control graphics parameters of texts in the boxes, The value of text can also be set as a list of data frames where the first column contains the text, from the second column contains graphics parameters for each text. The column names should be "col", "fontsize", "fontfamily" and "fontface".

background_gp

Graphics for the background.

which

Only "row" is allowed.

by

Are text boxed arranged by anno_link or by anno_block?

side

Side of the annotation to the heatmap.

...

Pass to textbox_grob.

Examples

require(circlize)
mat = matrix(rnorm(100*10), nrow = 100)

split = sample(letters[1:10], 100, replace = TRUE)
text = lapply(unique(split), function(x) {
	data.frame(month.name, col = rand_color(12, friendly = TRUE), fontsize = runif(12, 6, 14))
})
names(text) = unique(split)

Heatmap(mat, cluster_rows = FALSE, row_split = split,
    right_annotation = rowAnnotation(wc = anno_textbox(split, text))
)

jokergoo/ComplexHeatmap documentation built on Sept. 24, 2024, 4:48 p.m.