Here's a quick demo. I assume that we've already run the MCMC, and mcmc is the object returned by ancThresh. Data are in X:
> cols
not mod high
"green" "blue" "red"
> plotThresh(tree,X,mcmc,piecol=cols,tipcol="estimated", label.offset=0.01)
not mod high
"green" "blue" "red"
> plotThresh(tree,X,mcmc,piecol=cols,tipcol="estimated", label.offset=0.01)
Note that label.offset is on the scale of your phylogeny, so will have to be varied with total tree length. I've been meaning to migrate control of the pie sizes to the user, but have not yet had time to do so. (Plus, I've been sick.)
Hi Liam,
ReplyDeleteIs there now a way to change the pie sizes using plotThresh()? I am having a hard time visualizing my 310 tip tree.
Thanks!
Jon
Unfortunately, this is not presently an option. It is, however, possibly to plot the posterior probabilities on the tree 'manually' and adjust the node label size that way. An example of this can be seen here.
DeleteThanks for your prompt reply!
DeleteThe challenge has been plotting the nodelabels the way that plotThresh(... tipcols="input") does. The probability scores in my n x 4 matrix are unlike other "common" input values (e.g. binary, continuous). If I try:
> tiplabels(pie = x.matrix, ...)
I get this error, though I have no negative values in my x.matrix
Error in floating.pie.asp(XX[i], YY[i], pie[i, ], radius = xrad[i], col = piecol) :
floating.pie: x values must be non-negative
I'll keep working at it. Thanks again!