draw-HeatmapAnnotation-method {ComplexHeatmap} | R Documentation

## Draw the heatmap annotations

### Description

Draw the heatmap annotations

### Usage

    ## S4 method for signature 'HeatmapAnnotation'
    draw(object, index, k = NULL, n = NULL, align_to = "bottom", ...)

### Arguments

`object` | a `HeatmapAnnotation-class` object.
`index` | a vector of order.
`k` | if row annotation is splitted, the value identifies which row slice.
`n` | total number of row slices.
`align_to` | if the allocated space is more than than the column annotation itself, should the viewport be aligned to the top or bottom?
`...` | pass to `viewport` which contains all annotations.

### Details

A viewport is created. Mostly, this method is used inside `draw,HeatmapList-method`.

### Value

No value is returned.

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

    df = data.frame(type = c("a", "a", "a", "b", "b", "b"))
    ha = HeatmapAnnotation(df = df)
    grid.newpage(); draw(ha, 1:6)
    grid.newpage(); draw(ha, 6:1)

    ha = HeatmapAnnotation(df = df, col = list(type = c("a" =  "red", "b" = "blue")))
    grid.newpage(); draw(ha, 1:6)

    ha = HeatmapAnnotation(df = df, col = list(type = c("a" =  "red", "b" = "blue")),
        which = "row")
    grid.newpage(); draw(ha, 1:6)

    ha = HeatmapAnnotation(points = anno_points(1:6))
    grid.newpage(); draw(ha, 1:6)

    ha = HeatmapAnnotation(histogram = anno_barplot(1:6))
    grid.newpage(); draw(ha, 1:6)

    mat = matrix(rnorm(36), 6)
    ha = HeatmapAnnotation(boxplot = anno_boxplot(mat))
    grid.newpage(); draw(ha, 1:6)

[Package ComplexHeatmap version 1.20.0 Index]