YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/treedata-book/
821 stars 172 forks source link

geom_highlight compresses the tree slightly #607

Open maxfarrell opened 4 months ago

maxfarrell commented 4 months ago

I am trying to add a geom_hilight layer to identify two clades in a phylogeny. The tree is then aligned to a heatmap with cowplot. The alignment works well without the geom_hilight, but once it has been added, the tips of the tree become slightly compressed, and no longer properly aligns with the figure next to it.

I have tried adjusting plot margins of the tree, but the compression and subsequent mis-alignment is till taking place.

Any advice would be great!

wvictor14 commented 4 days ago

try adding scale_y_continuous(expand = expansion(0,0)) to the plot