YuLab-SMU / ggtree

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

branch.length #524

Closed SolayMane closed 2 years ago

SolayMane commented 2 years ago

I have an issue with ggtree when displying my tree with branch.length="none", the tip labels don't appear correctly:

image

brj1 commented 2 years ago

Either + coord_cartesian(clip="off") or + ggplot2::xlim(0, 0.06). You may need to adjust the 0.06.

See https://support.bioconductor.org/p/72398/ or #34

SolayMane commented 2 years ago

+ hexpand() was the best solution

nick-youngblut commented 1 year ago

+ coord_cartesian(clip="off") doesn't seem to work

require(ape)
tr <- rtree(10)
tr$tip.label = gsub('^', 'A long label: ', tr$tip.label)
ggtree(tr) + geom_tiplab() + coord_cartesian(clip="off") 

coord_cart

nick-youngblut commented 1 year ago

Neither does + ggplot2::xlim(0, 0.08) (no tree plotted)

xlim

nick-youngblut commented 1 year ago

Works:

require(ape)
tr <- rtree(10)
tr$tip.label = gsub('^', 'A long label: ', tr$tip.label)
ggtree(tr) + geom_tiplab() + xlim_tree(4)

xlim_tree