convert_length: Convert units

Description Usage Arguments Details Author(s) See Also Examples

Description

Convert units

Usage

1
convert_length(x, unit = c("mm", "cm", "inches"))

Arguments

x

a numeric vector

unit

supported units, only "mm", "cm", "inches".

Details

This function coverts mm/cm/inches units to units measured in the canvas coordinate, e.g. how much is it in the canvas coordinate for 1 mm/cm/inches.

Since in the circular plot, the aspect ratio is always 1, it does not matter this conversion is applied on x direction or y direction.

Author(s)

Zuguang Gu <[email protected]>

See Also

convert_x and convert_y convert absolute units into a data coordinate in a specified cell.

Examples

1
2
3
4
5
6
7
8
9
fa = letters[1:10]
circos.par(cell.padding = c(0, 0, 0, 0), track.margin = c(0, 0))
circos.initialize(fa, xlim = cbind(rep(0, 10), runif(10, 0.5, 1.5)))
circos.track(ylim = c(0, 1), track.height = convert_length(5, "mm"))
circos.par(track.margin = c(0, convert_length(2, "mm")))
circos.track(ylim = c(0, 1), track.height = convert_length(1, "cm"))
circos.par(track.margin = c(0, convert_length(5, "mm")))
circos.track(ylim = c(0, 1), track.height = convert_length(1, "inches"))
circos.clear()

1156054203/circlize- documentation built on May 22, 2019, 2 p.m.