anno_boxplot: Boxplot Annotation

View source: R/AnnotationFunction-function.R

anno_boxplotR Documentation

Boxplot Annotation

Description

Boxplot Annotation

Usage

anno_boxplot(x, which = c("column", "row"), border = TRUE,
    gp = gpar(fill = "#CCCCCC"), ylim = NULL, extend = 0.05, outline = TRUE, box_width = 0.6,
    add_points = FALSE, pch = 16, size = unit(4, "pt"), pt_gp = gpar(), axis = TRUE,
    axis_param = default_axis_param(which), width = NULL, height = NULL, ...)

Arguments

x

A matrix or a list. If x is a matrix and if which is column, statistics for boxplots are calculated by columns, if which is row, the calculation is done by rows.

which

Whether it is a column annotation or a row annotation?

border

Wether draw borders of the annotation region?

gp

Graphic parameters for the boxes. The length of the graphic parameters should be one or the number of observations.

ylim

Data ranges.

extend

The extension to both side of ylim. The value is a percent value corresponding to ylim[2] - ylim[1].

outline

Whether draw outline of boxplots?

box_width

Relative width of boxes. The value should be smaller than one.

add_points

Whether add points on top of the boxes?

pch

Point style.

size

Point size.

pt_gp

Graphics parameters for points.

axis

Whether to add axis?

axis_param

parameters for controlling axis. See default_axis_param for all possible settings and default parameters.

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.

...

Other arguments.

Value

An annotation function which can be used in HeatmapAnnotation.

See Also

https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html#box-annotation

Examples

set.seed(123)
m = matrix(rnorm(100), 10)
anno = anno_boxplot(m, height = unit(4, "cm"))
draw(anno, test = "anno_boxplot")
anno = anno_boxplot(m, height = unit(4, "cm"), gp = gpar(fill = 1:10))
draw(anno, test = "anno_boxplot with gp")

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