phytools : setMap
RのパッケージphytoolsのコマンドsetMapでは、contMapで描いた系統樹の枝の色を変えられる。
-----------------------------------------------
library(phytools)
Tree<-pbtree(n=15)
x<-c(runif(15))
labels<-c("t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15")
names(x)<-labels
contTree<-contMap(Tree, x, res=100)
###色付けされた系統樹のオブジェクトを設定
setTree<-setMap(contTree,colors=c("blue","purple","red"))
###青→紫→赤の順になるよう設定
plot(setTree)
###図示
-----------------------------------------------