Monday, June 24, 2013

New versions of phytools 3D methods

In my Evolution 2013 meeting talk (which I will put online soon), I showed a couple of old 3D visualization methods: a three-dimensional projection of the tree into morphospace ("phylomorphospace"); and a 3D traitgram visualization method in which x & y are phenotypic trait axes, while z represents the time since the root.

To make the plots I made a few minor updates to the two functions in which these methods are implemented: phylomorphospace3d and fancyTree(...,type="traitgram3d"). These updates are in a new phytools version (phytools 0.2-87). Here's a quick demo of how to create these as .gifs:

> require(phytools)
Loading required package: phytools
> packageVersion("phytools")
[1] ‘0.2.87’
> # simulate tree & data
> tree<-pbtree(n=40)
> X<-fastBM(tree,nsim=3)
> # create 3D phylomorphospace
> xx<-phylomorphospace3d(tree,X)
> movie3d(xx,duration=20,dir=".",movie= "phylomorphospace3d")
Will create: ./phylomorphospace3d.gif
Executing: convert -delay 1x10 phylomorphospace3d*.png phylomorphospace3d.gif
Deleting frames.
> # create 3D traitgram
> xx<-fancyTree(tree,type="traitgram3d",X=X[,1:2])
> movie3d(xx,duration=20,dir=".",movie="traitgram3d")
Will create: ./traitgram3d.gif
Executing: convert -delay 1x10 traitgram3d*.png traitgram3d.gif
Deleting frames.

That's it for now.


  1. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works. 3d visualisering stavanger

  2. I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. 3d visualisering oslo