Saturday, August 8, 2015

Update to cladelabels: Horizontal labeling & better label position using adj instead of pos

I just updated the phytools function cladelabels to allow the text of clade labels to be plotted horizontally instead of rotated 90 degrees to be plotted with a vertical orientation (the default). I did this for the tree from an empirical project underway in my lab in which (on the scale the tree was being plotted) the size of one of the clades we wanted to demarcate did not allow for enough space for the desired text of the clade label.

I also switched from using pos to specify the text position in the base graphics function text to adj - which seems to work better in centering the text on the clade label.

Here is a quick example to demo the modification to the function:

cladelabels(tree,node=169,text="clade 1")
cladelabels(tree,node=141,text="clade 2")
cladelabels(tree,node=126,text="clade 3",orientation="horizontal")

plot of chunk unnamed-chunk-1

I have added this update to a new version of phytools (phytools 0.4-64) which can be downloaded & installed from source - and it will also be in the next CRAN version of the package.

No comments:

Post a Comment