plot phylogenetic tree with ggtree
0
0
Entering edit mode
5.6 years ago

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 • 2.1k views
ADD COMMENT
0
Entering edit mode

Can you upload your tree and matrix data ?

ADD REPLY

Login before adding your answer.

Traffic: 1687 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6