circos.stackedText: Add a stacked text track

View source: R/low_level.R

circos.stackedTextR Documentation

Add a stacked text track

Description

Add a stacked text track

Usage

circos.stackedText(sectors, x, text,
    col = par("col"), font = par("font"), cex = par("cex"), family = par("family"),
    bg.border = "black", bg.col = "#FF8080",
    niceFacing = FALSE,
    side = c("outside", "inside"))

Arguments

sectors

A vector of sector names.

x

A vector of x-coordinates.

text

A vector of texts.

bg.border

Background color.

bg.col

Colors for borders.

niceFacing

Current not supported.

side

Side of the track.

col

Text colors.

font

Text fontfaces.

cex

Font sizes.

family

Font families.

Details

The height of the track is not fixed, so you may need to manually adjust the track height.

Examples

## Not run: 
circos.par$circle.margin = 0.5
circos.par$cell.padding = rep(0, 4)
circos.par$track.margin = rep(0, 2)

circos.initialize(sectors = letters[1:4], xlim = c(0, 1))

sectors = sample(letters[1:4], 40, replace = TRUE)
x = runif(40)
text = sapply(letters[sample(26, 40, replace = TRUE)], function(x) strrep(x, sample(4:6, 1)))
circos.stackedText(sectors, x, text, bg.col = "#EEEEEE")

circos.track(ylim = c(0, 1))
circos.clear()

#### genome plot
circos.par$track.margin = rep(0, 2)
circos.par$cell.padding = rep(0, 4)

circos.initializeWithIdeogram(plotType = NULL)
bed = generateRandomBed(50)
text = sapply(
    letters[sample(26, nrow(bed), replace = TRUE)], 
    function(x) strrep(x, sample(4:6, 1))
)
bed$text = text

circos.stackedText(bed[, 1], bed[, 2], bed$text, cex = 0.7)
circos.genomicIdeogram()
circos.clear()


## End(Not run)

jokergoo/circlize documentation built on Nov. 17, 2023, 11:32 a.m.