spiral_rect | R Documentation |
Add rectangles to a track
spiral_rect(
xleft,
ybottom,
xright,
ytop,
gp = gpar(),
track_index = current_track_index()
)
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. |
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.