anno_histogram: Histogram Annotation

Description Usage Arguments Value See Also Examples

View source: R/AnnotationFunction-function.R

Description

Histogram Annotation

Usage

1
2
3
4
anno_histogram(x, which = c("column", "row"), n_breaks = 11,
    border = FALSE, gp = gpar(fill = "#CCCCCC"),
    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?

n_breaks

Number of breaks for calculating histogram.

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.

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.

Value

An annotation function which can be used in HeatmapAnnotation.

See Also

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

Examples

1
2
3
4
5
6
7
m = matrix(rnorm(1000), nc = 10)
anno = anno_histogram(t(m), which = "row")
draw(anno, test = "row histogram")
anno = anno_histogram(t(m), which = "row", gp = gpar(fill = 1:10))
draw(anno, test = "row histogram with color")
anno = anno_histogram(t(m), which = "row", n_breaks = 20)
draw(anno, test = "row histogram with color")

Example output

Loading required package: grid
========================================
ComplexHeatmap version 2.6.2
Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
Github page: https://github.com/jokergoo/ComplexHeatmap
Documentation: http://jokergoo.github.io/ComplexHeatmap-reference

If you use it in published research, please cite:
Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 
  genomic data. Bioinformatics 2016.

This message can be suppressed by:
  suppressPackageStartupMessages(library(ComplexHeatmap))
========================================

ComplexHeatmap documentation built on Nov. 14, 2020, 2:01 a.m.