spiral_bars | R Documentation |
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()
)
pos |
X-locations of the center of bars. |
value |
Height of bars. The value can be a simple numeric vector, or a matrix. |
baseline |
Baseline of the bars. Note it only works when |
bar_width |
Width of bars. |
gp |
Graphical parameters. |
track_index |
Index of the track. |
No value is returned.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.