Learn R Programming

spiralize (version 1.0.6)

spiral_rect: Add rectangles to a track

Description

Add rectangles to a track

Usage

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

Value

No value is returned.

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.

Examples

Run this code
# 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))

Run the code above in your browser using DataLab