Add bars to a track
spiral_bars(
pos,
value,
baseline = get_track_data("ymin", track_index),
bar_width = min(diff(pos)),
gp = gpar(),
track_index = current_track_index()
)
X-locations of the center of bars.
Height of bars. The value can be a simple numeric vector, or a matrix.
Baseline of the bars. Note it only works when value
is a simple vector.
Width of bars.
Graphical parameters.
Index of the track.
No value is returned.
# \donttest{
x = seq(1, 1000, by = 1) - 0.5
y = runif(1000)
spiral_initialize(xlim = c(0, 1000))
spiral_track(height = 0.8)
spiral_bars(x, y)
# a three-column matrix
y = matrix(runif(3*1000), ncol = 3)
y = y/rowSums(y)
spiral_initialize(xlim = c(0, 1000))
spiral_track(height = 0.8)
spiral_bars(x, y, gp = gpar(fill = 2:4, col = NA))
# }