Skip to content

cophylo plot doesn't produce trees, only two vertical lines #168

@mprodriguezp

Description

@mprodriguezp

Hi,

I've been trying to use the coplot function to compare two phylogenetic trees (both have the same 522 tips), but the plot only shows two vertical black lines like shown below. I tried saving the file with a big size to see if it was a matter of plot margins in R, but it's not. Image

Below is the code I've been using. Since both trees share the same tips (I double-checked this), I created the association matrix with a dataframe using the tips of one tree. I also double-checked that both trees are phylo objects and the obj summary looks good, and I tried both rotation T or F, but I got the same result.

library(ape)
library(phytools)


tree200 <- read.tree("./withchunk200/varistes.chunk200.nwk")
tree92 <- read.tree("./withchunk92/varsites.chunk92.nwk")

assoc <- data.frame("t200" = tree200$tip.label,
                    "t92" = tree200$tip.label)

obj<-cophylo(tree200,tree92,rotate=FALSE,assoc=assoc)
obj<-cophylo(tree200,tree92,assoc=assoc)
summary(obj)
plot(obj)

Could you please tell me what am I doing wrong, please? I am new in phytools, but I think I am doing the basic stuff that the code needs according to previous examples in the blog and in other websites.

Thanks in advance,
Maria

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions