On the R-sig-phylo list a subscriber
some weird behavior from the phytools plotting method for objects of class
"cophylo". I don't have the original dataset, but it looked
## Rotating nodes to optimize matching... ## Done.
I.e., the trees facing the wrong way!
This is actually easier to fix than it looks. It is really just a product of having very long labels. The function tries to fit everything, but the effect is that the edge lengths become negative. Oops.
We can either change our font size in the same size plotting device:
Or, perhaps better, we can change the size of our plotting device:
To export directly to PDF, we would do this using the
width arguments in
pdf(file="cophylo.pdf",height=8.5,width=11) plot(obj) dev.off()
## windows ## 2
BTW, the trees were generated here as follows:
library(phytools) tips<-vector() for(i in 1:26) tips[i]<-paste(sample(c(LETTERS,letters),25),collapse="") tr1<-rtree(n=26,tip.label=tips) for(i in 1:26) tips[i]<-paste(sample(c(LETTERS,letters),25),collapse="") tr2<-rtree(n=26,tip.label=tips) assoc<-cbind(sample(tr1$tip.label),sample(tr2$tip.label))