Draw rectangle-like grid
circos.rect(
xleft, ybottom, xright, ytop,
sector.index = get.current.sector.index(),
track.index = get.current.track.index(),
rot = 0,
...)
x for the left bottom points
y for the left bottom points
x for the right top points
y for the right top points
Index for the sector
Index for the track
Rotation of the rectangles. The value is measured clockwise in degree. Rotation is relative to the center of the rectangles.
pass to polygon
The name for this function is circos.rect
because if you imagine the plotting region as Cartesian coordinate, then it is rectangle.
in the polar coordinate, the up and bottom edge become two arcs.
This function can be vectorized.
# NOT RUN {
circos.initialize(c("a", "b", "c", "d"), xlim = c(0, 10))
circos.track(ylim = c(0, 10), panel.fun = function(x, y) {
for(rot in seq(0, 360, by = 30)) {
circos.rect(2, 2, 6, 6, rot = rot)
}
}, track.height = 0.5)
# }
Run the code above in your browser using DataLab