Avoid overlapping tip labels

1,156 views
Skip to first unread message

Sarah Pohl

unread,
Apr 23, 2019, 8:30:00 AM4/23/19
to ggtree
Hey!

Is there a way to avoid a tip label overlap in big trees? I have a tree with over 400 tips and have to keep the label font size really small to avoid overlaps. I saw the link to ggrepel in the FAQ, but that only works with a defined "label" class, and geom_tiplab(2) doesn't support that. Or am I doing something wrong?

Thanks in advance for your help!
Sarah

Yu, Guangchuang

unread,
May 16, 2019, 10:08:46 AM5/16/19
to Sarah Pohl, ggtree

--
1. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
2. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
3. Book: https://yulab-smu.github.io/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/e778d4da-2fd1-4e3c-94d1-a29a46430ea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--~--~---------~--~----~------------~-------~--~----~
Guangchuang Yu PhD
Professor
School of Basic Medical Sciences
Southern Medical University
Guangzhou, China
-~----------~----~----~----~------~----~------~--~---

Sarah Pohl

unread,
May 21, 2019, 7:38:02 AM5/21/19
to ggtree
Thank you, I didn't find that suggestion. It doesn't seem to change anything about the distance of the tips, though. I have 424 samples, and only 38 I want to label, but still some of the labels overlap.


On Thursday, 16 May 2019 16:08:46 UTC+2, Yu, Guangchuang wrote:
On Tue, Apr 23, 2019 at 8:30 PM Sarah Pohl <no...@hotmail.de> wrote:
Hey!

Is there a way to avoid a tip label overlap in big trees? I have a tree with over 400 tips and have to keep the label font size really small to avoid overlaps. I saw the link to ggrepel in the FAQ, but that only works with a defined "label" class, and geom_tiplab(2) doesn't support that. Or am I doing something wrong?

Thanks in advance for your help!
Sarah

--
1. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
2. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
3. Book: https://yulab-smu.github.io/treedata-book/
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-...@googlegroups.com.

Pedro Senna

unread,
May 21, 2019, 8:52:22 AM5/21/19
to Sarah Pohl, ggtree
Hi Sarah,

You Just need to provide more space for the tree when saving. You can Control It by using ggsave(height = x). By providing more space, tips should not overlap anymore. 

Cheers,

Pedro.


To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.

To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
Reply all
Reply to author
Forward
0 new messages