Wednesday, June 26, 2013

User control of node sizes in phylomorphospace

A phytools user requests:

Is there a way to turn off the internal nodes in the phylomorphospace function in phytools?

I decided to interpret this more generally as a request for user control over the size of the plotted points at terminal and internal nodes in a phylomorphospace (that is, a bivariate projection of the tree into morphospace) plot.

This was easy enough to add and is now an optional argument in the phylomorphospace function. Point size is controlled using the cex argument in points - which adjusts the plotted point size relative to the default (1.0). Code for the new version is here and I also posted a new phytools build (phytools 0.2-88) containing this update.

Here's a demo, using the original request above:

> require(phytools)
Loading required package: phytools
> packageVersion("phytools")
[1] ‘0.2.88’
> tree<-pbtree(n=30)
> X<-fastBM(tree,nsim=2)
> layout(matrix(c(1,2),1,2))
> plotTree(tree,mar=c(3.2,0.1,1.4,0.1))
> par(mar=c(4.1,4.1,2.1,0.5))
> phylomorphospace(tree,X,node.size=c(0,1.3),lwd=2, xlab="x",ylab="y",xlim=c(-4.2,2.2))
(Full resolution.)

1 comment:

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