This is a test version of Biostars. For the public version, visit https://www.biostars.org.
plot phylogenetic tree with ggtree

hello, I would like to do a plot with ggtree, I have a phylogenetic tree, a vector with continuous values, and a matrix with binary data (0 and 1). I'd like to plot them in an single plot, I mean colour the tree with the continuous scale and a heatmap with binary data, I have tried whit the next code, but it doesn't work

          p <- ggtree(phylogenetic_tee, mrsd="2018-10-01",ladderize = T) + geom_treescale(x=2008, y=-1, offset=1) 
p <- p + geom_tiplab()
    p %<+% vector_continuouos + aes(color=my_var)
        heatmap_b <- gheatmap(p, binary_matrix, offset=1, width=2, font.size=1, colnames_angle=90, hjust=0.01,low = "green",
                 high = "blue", color = "white", colnames = TRUE,
                 colnames_position = "top") +
          scale_color_continuous(aes(color=my_var ),low='darkgreen', high='red')
r

Can you upload your tree and matrix data ?

0 answers

No answers yet.

Log in to answer this question.