tgplot_add_axis_annotation | R Documentation |
Add an axis annotation to a ggplot matrix
tgplot_add_axis_annotation(
heatmap,
annotation,
position = "bottom",
size = 0.02,
label = NULL,
plot_left = TRUE,
plot_right = TRUE,
label_color = "black"
)
heatmap |
a ggplot matrix object - output of |
annotation |
can be either a vector of colors or a ggplot object |
position |
position of the axis annotation ("top", "bottom", "left" or "right") |
size |
width of the annotation |
label |
annotation label (optional) |
plot_left |
plot a label to the left of the annotation |
plot_right |
plot a label to the right of the annotation |
label_color |
color of the annotation label |
a gtable object. Can be plotted using cowplot::ggdraw
.
tgplot_heatmap(as.matrix(mtcars)) %>%
tgplot_add_axis_annotation(as.matrix(mtcars)[5, ] + 1) %>%
cowplot::ggdraw()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.