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

anno_text

Text Annotation


Description

Text Annotation

Usage

anno_text(x, which = c("column", "row"), gp = gpar(),
    rot = guess_rot(), just = guess_just(),
    offset = guess_location(), location = guess_location(),
    width = NULL, height = NULL)

Arguments

x

A vector of text.

which

Whether it is a column annotation or a row annotation?

gp

Graphic parameters.

rot

Rotation of the text, pass to grid.text.

just

Justification of text, pass to grid.text.

offset

Depracated, use location instead.

location

Position of the text. By default rot, just and location are automatically inferred according to whether it is a row annotation or column annotation. The value of location should be a unit object, normally in npc unit. E.g. unit(0, 'npc') means the most left of the annotation region and unit(1, 'npc') means the most right of the annotation region.

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.

Value

An annotation function which can be used in HeatmapAnnotation.

See Also

Examples

anno = anno_text(month.name)
draw(anno, test = "month names")
anno = anno_text(month.name, gp = gpar(fontsize = 16))
draw(anno, test = "month names with fontsize")
anno = anno_text(month.name, gp = gpar(fontsize = 1:12+4))
draw(anno, test = "month names with changing fontsize")
anno = anno_text(month.name, which = "row")
draw(anno, test = "month names on rows")
anno = anno_text(month.name, location = 0, rot = 45, 
    just = "left", gp = gpar(col = 1:12))
draw(anno, test = "with rotations")
anno = anno_text(month.name, location = 1, 
    rot = 45, just = "right", gp = gpar(fontsize = 1:12+4))
draw(anno, test = "with rotations")

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.