Two different people (Marcio Pie and a student whose name has somehow slipped my mind - please identify yourself!) independently suggested to me recently that I could use a similar approach to that employed when overlaying a posterior density map from stochastic mapping on a phylomorphospace to project time since the root of the tree onto a phylomorphospace. In theory, this would help overcome the difficulty that all temporal information about the phylogeny is lost when it is projected into morphospace.
Well, this is quite easy** (**that is, easy only because I've already programmed all the pieces in phytools) to do. Here's a hack using simulated data.
First let's load phytools & simulate tree & data:
Loading required package: phytools
> # simulate tree & data
> for(i in 1:nrow(H)) names(AA$tree$maps[[i]])<- round((H[i,1]+cumsum(AA$tree$maps[[i]]))/h*1000)
> # check to verify that temporal information is correct
> add.color.bar(2,AA$cols,title="time from the root", lims=c(0,h),digits=1)
Click where you want to draw the bar
The final step (add.color.bar(...)) is the biggest hack of all as it only works because I artfully positioned it close enough to the x axis so that the bottom legend text is hidden!
Try it out!