Color branches and points according to clade

23 views
Skip to first unread message

Ricardo Ely

unread,
Nov 22, 2024, 6:46:01 AM11/22/24
to ggtree
Hello, 

I am trying to color branches and points according to group in a simple 2D pca phylomorphospace. Here is an example code: 

library(ggtreeSpace)

PCA.scores <- read.csv("trait_pca.csv")

clades <- read.csv("clades.csv") # contains grouping information 

r.tree <- rtree(dim(PCA.scores)[1])

ggtreespace(tree, PCA.scores[,1:2], color = "#03045e") + geom_point(color = "#03045e")

Basically, something that looks like this via phylomorphospace in phytools except using ggtreeSpace (last figure on http://blog.phytools.org/2021/11/showing-different-orders-or-other.html). 

Also if there's a way in ggtree itself, help with that is fine too. 

Thank you! 

Best, 

Ricardo 


Reply all
Reply to author
Forward
0 new messages