ggtree
ggtree copied to clipboard
how to use ggtree to draw fan-shaped tree with geological time scale
Hi Dr. Yu, First, thank your for the ggtree package. I was wondering if you could help with this issue: can ggtree could produce a fan-shaped phylogeny with time scale as shown here. The circular lines denote the geological time. I found your previous reply about similar issue (https://github.com/YuLab-SMU/ggtree/issues/415), and the code is: ggtree(x) + theme(panel.grid.major=element_line()) + layout_circular() However, the circular line is equally spaced, rather than corresponding to geological time scale. Thank you in advance. Min
I also want to ask this
try:
set.seed(1)
tree <- rtree(100)
ggtree(tree) + theme(panel.grid.major=element_line(),
panel.grid.major.y=element_blank()) +
layout_circular() + scale_x_continuous(breaks=c(1,4,6))
We can use scale_x_continuous to specify the break points.
I would note that with @GuangchuangYu's solution, the breaks need to specified in terms of the amount of time since the root of the tree. This is because with the circular layout the root is put at the origin (polar coordinate x = 0).
您的来信已收到,我会尽快查看,谢谢陈曦