Add rectangles to a track
spiral_rect(
xleft,
ybottom,
xright,
ytop,
gp = gpar(),
track_index = current_track_index()
)
X-locations of the left bottom of the rectangles.
Y-locations of the left bottom of the rectangles.
X-locations of the right top of the rectangles.
Y-locations of the right top of the rectangles.
Graphical parameters.
Index of the track.
No value is returned.
# 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))