Thursday, July 11, 2013

Visualizing multivariate comparative data on trees: multipanel phylomorphospace plotting

This is kind of cool: a multipanel phylomorphospace plot for four different traits with a set of contMap univariate plots on the diagonal:

(Click here for higher resolution.)

Here's how I did it (ignoring the data simulation). Note that a new, non-CRAN version of phytools (phytools 0.2-96) is required to do this.

m<-ncol(X)
par(mfrow=c(m,m))
par(cex=0.6)
par(mar=c(0,0,0,0))
par(oma=c(5,5,3,3))
m<-ncol(X)
for(i in 1:m) for(j in 1:m){
  if(i==j) contMap(tree,X[,i],legend=FALSE,lwd=2,outline=F,
    fsize=0.5)
  else {
    phylomorphospace(tree,X[,c(j,i)],lwd=1,
      node.by.map=TRUE,axes=FALSE)
    if(i==1) axis(side=3) # top row
    if(i==m) axis(side=1) # first column
    if(j==1) axis(side=2) # bottom row
    if(j==m) axis(side=4) # last column
  }
}
par(cex=0.9)
mapply(title,xlab=colnames(X),adj=
  seq(0,(m-1)/m,1/m)+1/(2*m),MoreArgs=
  list(outer=TRUE,cex=0.9))
mapply(title,ylab=colnames(X)[m:1],adj=
  seq(0,(m-1)/m,1/m)+1/(2*m),MoreArgs=
  list(outer=TRUE,cex=0.9))

3 comments:

  1. Dear Liam,
    I find this R package very useful! but I have a very basic question, has any sense if I map onto the phylogeny the relative scores (each RW axis) which I have obtained from a geometric morphometric analysis? I want to build a phylomorphospace using relative warps (as in Sidlauskas 2008) and I found interesting this kind of visualization.
    Another question would be: is it possible mapping procrustes distances between tips and nodes?
    Thanks for your time,
    Best regard,
    Alicia

    ReplyDelete
  2. Some go so far as to acquire and provision their own infrastructure to accelerate data collection, processing and analysis. This time-to-market rush creates data silos and potential GRC (governance, regulatory, compliance) risks.
    call center dashboards

    ReplyDelete
  3. To find out which graph or chart will be the most effective for your data, make sure you identify the purpose of your data and how you want the readers to interpret them.bank and financial dashboards

    ReplyDelete