In tinkering with the visualization function I just added to phytools
to plot a phylogenetic
I realized that an important limitation of the function as written was that
all columns of
X are plotted on the same scale. That means that
for traits with low among-species variability, it might be difficult to
detect otherwise strong phylogenetic patterns in the data.
For example, here I will simulate a tree & then trait data for 10 traits with various values of σ.
library(phytools) tree<-rcoal(n=30) X<-sapply(setNames((1:10)^2,paste("sig=",1:10,sep="")), function(sig2,tree) fastBM(tree,sig2=sig2),tree=tree) phylo.heatmap(tree,X)
The problem with this is fairly obvious. Traits with low σ show little evidence for phylogenetic structure because it is just not captured by the color ramp that is specified.
An easy solution to this is to first standardize the columns to have the same variance and then re-run the analysis. Here is what that looks like:
I also added some other updates to the legend placement & the labels. The update can be seen here or installed directly from GitHub using detools.