ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

gheatmap: colour columns individually from binary data

Open clarkevansteenderen opened this issue 3 years ago • 0 comments
trafficstars

Hello Prof. Yu,

Do you perhaps know how I can colour each column in the heatmap alongside a phylogeny individually? I've got a binary dataset, and I can get it to plot all the zero values as white, and the 1-values as blue, for example. But I'd like to be able to specify different colours for the presence values in the different columns. Here is the code I have so far:

binary_phylo = gheatmap(iqtree_iotree, host.plants, offset=0.05, width=0.2, colnames_position = "top", colnames_angle = 90, font.size=1, color="black", colnames_offset_y = 2) + scale_fill_manual(values=c("white", "darkblue")) + theme(legend.position="bottom") + geom_treescale()

And here is what I'm looking to do - see image B below.

Thank you!

Kind regards,

Clarke

ggtree_query

clarkevansteenderen avatar May 31 '22 11:05 clarkevansteenderen