YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/contribution-tree-data/
839 stars 173 forks source link

how to keep branch length and resolved root, simultaneously? #480

Open felixlee0608 opened 2 years ago

felixlee0608 commented 2 years ago
pacman::p_load(treeio,ggtree,patchwork)
set.seed(100)
p1 <- ggtree(root(rtree(10),outgroup="t10",resolve.root=T),branch.length = 'none')+geom_label2(aes(label=label))
p2 <- ggtree(root(rtree(10),outgroup="t10",resolve.root=T))+geom_label2(aes(label=label))
p1+p2+plot_annotation(tag_levels = 'A')
ggtree1

keep root as bifurcating node and keep branch length, simultaneously.