spiral_rect: Add rectangles to a track

View source: R/graphics.R

spiral_rectR Documentation

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()
)

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

# 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 June 22, 2024, 10:45 a.m.