geom_range is centralized to the node height

28 views
Skip to first unread message

Tiago Gräf

unread,
Jul 26, 2024, 11:08:44 AM7/26/24
to ggtree
Hi, 
I just noticed that my command geom_range("height_0.95_HPD", color='gray', size=2, alpha=.5) is putting the bar range centralized in the node heigh, showing equal range in both sides. This is not the expected behavior since the node heights of my MCC tree are not the mean of the  tree distribution, but their represent a single tree (the MCC tree). 
Below are two images comparing node bars (please ignore the colors) of ggtree  Screenshot 2024-07-26 at 12.00.50.png   

and figtree
Screenshot 2024-07-26 at 12.01.27.png

and here is my code:

t = ggtree(MCCtree,size=0.5, alpha = 0.8, aes(color=loc),
           mrsd="2024-05-23",as.Date = F,
           ladderize = T, right = F)
t = t + geom_tippoint(aes(color=loc), size=1, alpha=1) #Colore os tippoints
t = t + geom_nodepoint(aes(subset=(posterior>=0.9), x=branch),size=0.5, color="black", alpha=1) #Node points posterior
t = t + geom_range("height_0.95_HPD", color='gray', size=2, alpha=.5)
t = t + scale_color_manual(values = Locations.col)
t = t + coord_cartesian(clip = "off") + theme_tree2(axis.text.x = element_text(angle=90))#plot.margin = margin(5,10,0,0))
t

Am I doing something wrong or is this a bad behavior of the function?
Reply all
Reply to author
Forward
0 new messages