library(ape)
library(phytools)
library(ggplot2)
library(ggtree)
set.seed(200)
tree<-force.ultrametric(rtree(100))
plot(tree,type="fan",cex=0.5,lwd=0.6)
arc.cladelabels(text="This Is A Very Long Clade Name",node=mrca(tree)["t41","t6"],mark.node=TRUE,
ln.offset=1.135,lab.offset = 1.22,fsize=1.,orientation="curved")
I have previously plotted trees in this manner using phytools, however I wish to try and start doing it in ggtree because I find the ggplot language more flexible in its application. However, I noticed that there doesn't seem to be an option to create arced clade labels using geom_cladelab. The closest I have been able to do to replicate the tree above is as shown below.
ggtree(tree,layout="circular")+
geom_tiplab()+
geom_cladelab(offset=1,label="This Is A Very Long Clade Name",node=mrca(tree)["t41","t6"],horizontal=FALSE, angle="auto",vjust=1,hjust=0.5,colour="blue")
The auto angle function is nice, but it would be nice to have the clade names arched in order to save space when there are very long clade names and it is not desired to have the clade names extend significantly away from the graph. Phytools' function also always has the clade labels facing the same direction (with the bottom towards the root of the tree), but it does not seem to be possible to do this using ggtree. I have checked online through Google and Stack Overflow and through the ggtree handbook and vignettes and there does not seem to be any option to plot a curved clade label in ggtree. Do you know if such a function exists, or if it could be added to a later release?
In the phytools package there is an option to plot clade names as an arc using the arc.cladelabels function.
I have previously plotted trees in this manner using phytools, however I wish to try and start doing it in ggtree because I find the ggplot language more flexible in its application. However, I noticed that there doesn't seem to be an option to create arced clade labels using geom_cladelab. The closest I have been able to do to replicate the tree above is as shown below.
The auto angle function is nice, but it would be nice to have the clade names arched in order to save space when there are very long clade names and it is not desired to have the clade names extend significantly away from the graph. Phytools' function also always has the clade labels facing the same direction (with the bottom towards the root of the tree), but it does not seem to be possible to do this using ggtree. I have checked online through Google and Stack Overflow and through the ggtree handbook and vignettes and there does not seem to be any option to plot a curved clade label in ggtree. Do you know if such a function exists, or if it could be added to a later release?
Prerequisites
Describe you issue
Ask in right place