This update comes from two places. First, from the fact that for non-ultrametric
trees the visualization using the previous version of
looks kind of weird. For instance:
library(phytools) tree<-rtree(n=26,tip.label=LETTERS) x<-fastBM(tree) dotTree(tree,x)
It is not terrible, but it would be better if all the plotted tip states lined up at the same place.
Next, when I posted this to Facebook (and, actually in the original email that inspired this method), there was a request to add multiple traits. Putting these betweem the end of the tip and the tip label seemed pretty impractical.
With these factors in consideration, I decided to try a different internal
plotting method - the same one that is used in the phytools function plotting
method for objects of class
This is what that looks like for the same data:
Using this method internally & moving the dots to the right of the plotted tip labels also makes it very convenient to show multiple traits, which I also added as a feature. For example:
Once again, this doesn't look very good for trees with more than 60 or 70 taxa:
tree<-rtree(n=60) X<-fastBM(tree,nsim=12) dotTree(tree,X,fsize=0.7,cex=0.7)
I should warn that there are certainly some bugs still being worked out (some were discovered in the writing of this post), & feedback on bugs, as well as feedback generally, is welcome.
The easiest way to use this function is to update phytools from GitHub using the devtools package, e.g.: