liamrevell / phytools

GNU General Public License v3.0
207 stars 56 forks source link

Align clade labels in phylogeny #26

Closed lauracespedesarias closed 4 years ago

lauracespedesarias commented 6 years ago

Hello Liam and all,

I am using the cladelabels function in phytools to annotate clades in a cladogram. I want to annotate several clades but I have found difficult to have the lines (produce by cladelabels) aligned between clades. I figured this is because I am not using the 'offset' argument correctly. Is there a way to have all these perfectly aligned? This would make the figure much better. Thank you very much for your help with this.

Best,

Laura Céspedes

liamrevell commented 6 years ago

Hi Laura. Can you send me an example with code?

lauracespedesarias commented 6 years ago

Hi Liam, Thank you very much for your answer. I ended up using 'geomclade' from the ggtree package to do this and therefore do not have the code for this now. Thanks anyway. Best, Laura

AgustinPardo commented 4 years ago

I have the same issue!

liamrevell commented 4 years ago

I believe that offset is calculated from the height of the tips of the tree. If the tree is ultrametric then cladelabels with the same offset will be aligned. If not, you need to compute the difference between the height of the highest tip in your clade and the total length of the tree in order to fix offset values that cause the clade labels to align.