anno_numeric: Numeric labels annotation

View source: R/AnnotationFunction-function.R

anno_numericR Documentation

Numeric labels annotation

Description

Numeric labels annotation

Usage

anno_numeric(x, rg = range(x), labels_gp = gpar(), x_convert = NULL,
    labels_format = NULL, labels_offset = unit(4, "pt"),
    bg_gp = gpar(fill = "#8080FF", col = "#8080FF"),
    bar_width = unit(1, "npc") - unit(4, "pt"),
    round_corners = TRUE, r = unit(0.05, "snpc"),
    which = c("row", "column"), align_to = "left", width = NULL)

Arguments

x

A vector of numeric values.

rg

Range. A numeric vector of length two.

labels_gp

Graphics parameters for labels.

x_convert

A function applied on x. E.g. when x contains p-values, to map x to the heights of bars, a transformation of -log10(x) is normally applied.

labels_format

A function applied on x. E.g., when x is a numeric, labels_format can be set to function(x) sprintf("%.2f", x).

labels_offset

Offset of labels to the left or right of bars.

bg_gp

Graphics parameters for the background bars.

bar_width

Width of bars. Note it corresponds to the vertical direction.

round_corners

Whether to draw bars with round corners?

r

Radius of the round corners.

which

Row or column. Currently it only supports row annotation.

align_to

Which side bars as well as the labels are aligned to. Values can be "left" or "right". If x contains both positive and negative values, align_to can also be set to 0 so that bars are aligned to pos = 0.

width

Width of the annotation.

Examples

m = matrix(rnorm(100), 10)
x = rnorm(10)
Heatmap(m, right_annotation = rowAnnotation(numeric = anno_numeric(x)))

jokergoo/ComplexHeatmap documentation built on Nov. 17, 2023, 11:27 a.m.