I am working on a phylogenetic tree with R package ggtree and want to highlight nodes.
My tree is stored in p, and the node I want to highlight is in G10.
p <- ggtree(tree, right=T, layout="circular")
G10 <- findMRCA(tree, c("genome1","genome2","genome3","genome4"), type=c("node"))
I highlight the node like this:
p + geom_hilight(node=G10, fill="forestgreen", extendto = 0.6, alpha=1)
I would like to use alpha=1
to get a nice, strong colour, but this colours over/hides the tips in the tree so you can't see them (see image). Is there a way of plotting this so the highlight is behind the tree, so that I can still see the tips?
EDIT: I haven't found a good solution but I came up with a temporary fix that works for now:
Create two plots: a transparent plot of the tree p + theme_transparent()
, and the tree with the highlights p + geom_hilight(node=G10, fill="forestgreen", extendto = 0.6, alpha=1)
and overlay the transparent plot on the highlighted plot in powerpoint and save.