You're not actually using ggtree
to plot here. If you wish to draw your tree with ggtree
you could do something like this:
library(ggtree)
library(ggplot2)
set.seed(123)
tree <- rtree(30)
ggplot(tree) +
geom_tree() +
geom_tiplab() +
geom_text(aes(0.5, 20), label = 'Group 1',
check_overlap = TRUE, color = 'red', size = 6) +
theme_void()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.