Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

anno_block

Block annotation


Description

Block annotation

Usage

anno_block(gp = gpar(), labels = NULL, labels_gp = gpar(), labels_rot = ifelse(which == "row", 90, 0),
    which = c("column", "row"), width = NULL, height = NULL, show_name = FALSE)

Arguments

gp

Graphic parameters.

labels

Labels put on blocks.

labels_gp

Graphic parameters for labels.

labels_rot

Rotation for labels.

which

Is it a row annotation or a column annotation?

width

Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation.

height

Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation.

show_name

Whether show annotatio name.

Details

The block annotation is used for representing slices. The length of all arguments should be 1 or the number of slices.

Value

An annotation function which can be used in HeatmapAnnotation.

See Also

Examples

Heatmap(matrix(rnorm(100), 10), 
    top_annotation = HeatmapAnnotation(foo = anno_block(gp = gpar(fill = 2:4),
        labels = c("group1", "group2", "group3"), labels_gp = gpar(col = "white"))),
    column_km = 3,
    left_annotation = rowAnnotation(foo = anno_block(gp = gpar(fill = 2:4),
        labels = c("group1", "group2", "group3"), labels_gp = gpar(col = "white"))),
    row_km = 3)

ComplexHeatmap

Make Complex Heatmaps

v2.6.2
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.