After writing yesterday about how to create an ANSI text graphic style phylogeny using -
and |
characters, it occurred to me that this could be generalized to any character type, such as *
or even letters. Of course, I couldn’t resist adding this in to phytools. (I can’t promise I won’t take it out again later.)
Here are a couple of examples.
library(phytools)
data(bat.tree)
ansi_phylo(bat.tree,vertical="#",horizontal="*")
Here, let’s cheat a little and change our character size for branches and tip labels. (This is not really ANSI, because that wouldn’t be allowed.)
par(cex=0.4)
data(mammal.tree)
ansi_phylo(mammal.tree,vertical="/",horizontal="/",fsize=1.3)
Being honest, that’s not half bad, right?
If we want to be really silly, we can even use letters.
data(sunfish.tree)
ansi_phylo(sunfish.tree,vertical="b",horizontal="a")
Next step of geekyness is plotting the ancestral states as one letter code in ansi_phylo like plotSimmap ;)
ReplyDeleteCheers,
Klaus