spiral_rect: Add rectangles to a track

Description Usage Arguments Value Examples

View source: R/graphics.R

Description

Add rectangles to a track

Usage

1
2
spiral_rect(xleft, ybottom, xright, ytop, gp = gpar(),
    track_index = current_track_index())

Arguments

xleft

X-locations of the left bottom of the rectangles.

ybottom

Y-locations of the left bottom of the rectangles.

xright

X-locations of the right top of the rectangles.

ytop

Y-locations of the right top of the rectangles.

gp

Graphical parameters.

track_index

Index of the track.

Value

No value is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# to simulate heatmap
n = 1000
require(circlize)
col = circlize::colorRamp2(c(0, 0.5, 1), c("blue", "white", "red"))
spiral_initialize(xlim = c(0, n))
spiral_track(height = 0.9)

x1 = runif(n)
spiral_rect(1:n - 1, 0, 1:n, 0.5, gp = gpar(fill = col(x1), col = NA))
x2 = runif(n)
spiral_rect(1:n - 1, 0.5, 1:n, 1, gp = gpar(fill = col(x2), col = NA))

spiralize documentation built on Feb. 6, 2022, 1:06 a.m.