arborworkflows / aRbor

aRbor, an R package with useful functions for Arbor workflows
5 stars 3 forks source link

legend is missing for ancestral state plot for discrete traits #38

Closed bobthacker closed 9 years ago

bobthacker commented 9 years ago

We need to put the legend back on the tree for the ancestral state plot for discrete traits. In R I usually use colors<-rainbow(nlevels(trait)) tiplabels(pch=21, bg=colors[as.numeric(trait)], cex=2.5, adj=1) nodelabels(pie = ans$lik.anc, piecol = colors, cex = 0.5) legend(locator(),c(levels(trait)), fill=colors, cex=1, xpd=TRUE, horiz = FALSE)

For aRbor, should this be legend("topleft",c(levels(trait)), fill=colors, cex=1, xpd=TRUE, horiz = FALSE)

uyedaj commented 9 years ago

fixed