Description Usage Arguments Details Value See Also Examples
View source: R/AnnotationFunction-function.R
Horizon chart Annotation
1 2 3 4 5 6 |
x |
A matrix or a list. If |
which |
Whether it is a column annotation or a row annotation? |
gp |
Graphic parameters for the boxes. The length of the graphic parameters should be one or the number of observations. There are two unstandard parameters specificly for horizon chart: |
n_slice |
Number of slices on y-axis. |
slice_size |
Height of the slice. If the value is not |
negative_from_top |
Whether the areas for negative values start from the top or the bottom of the plotting region? |
normalize |
Whether normalize |
gap |
Gap size of neighbouring horizon chart. |
axis |
Whether to add axis? |
axis_param |
parameters for controlling axis. See |
width |
Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation. |
height |
Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation. |
Horizon chart as row annotation is only supported.
An annotation function which can be used in HeatmapAnnotation
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | lt = lapply(1:20, function(x) cumprod(1 + runif(1000, -x/100, x/100)) - 1)
anno = anno_horizon(lt, which = "row")
draw(anno, test = "horizon chart")
anno = anno_horizon(lt, which = "row",
gp = gpar(pos_fill = "orange", neg_fill = "darkgreen"))
draw(anno, test = "horizon chart, col")
anno = anno_horizon(lt, which = "row", negative_from_top = TRUE)
draw(anno, test = "horizon chart + negative_from_top")
anno = anno_horizon(lt, which = "row", gap = unit(1, "mm"))
draw(anno, test = "horizon chart + gap")
anno = anno_horizon(lt, which = "row",
gp = gpar(pos_fill = rep(c("orange", "red"), each = 10),
neg_fill = rep(c("darkgreen", "blue"), each = 10)))
draw(anno, test = "horizon chart, col")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.