Thursday, May 14, 2015

Small update to control legend text in contMap

I just added a small update to the phytools function contMap, for mapping a continuous character's evolution on the tree. Now the user has control over the legend title. This was possible before (e.g., see Figure 4.4 here), just trickier and required a separate call to add.color.bar. Code for this update is here and it will be in future versions of phytools.

Here's a quick demo:

library(phytools)
data(anoletree)
X<-read.csv("http://tinyurl.com/pg7efmb",row.names=1)
rownames(X)<-paste("Anolis_",rownames(X),sep="")
svl<-setNames(X[,"SVL"],rownames(X))[anoletree$tip.label]
obj<-contMap(anoletree,svl,plot=FALSE)
source("contMap.R")
plot(obj,fsize=c(0.7,1),leg.txt="log(SVL)",lwd=3)

plot of chunk unnamed-chunk-1

That's it.

No comments:

Post a Comment

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.