lizzieinvancouver / ospree

Budbreak review paper database
3 stars 0 forks source link

Plotting labels on phylogeny tips #458

Open DeirdreLoughnan opened 1 year ago

DeirdreLoughnan commented 1 year ago

@MoralesCastilla @lizzieinvancouver mentioned you are trying to plot family names on the tips of your tree.

In case it is helpful, this is how I ended up labeling my tree in the end. I used the ggtree package and the node number for a species in each group. But when the labels of the groups overlapped, I was able to set the x/y coordinate where I wanted the label.

ggtree(aaTree, layout = 'circular', branch.length = 'none') +
  aes(color = tree_data$Species)+ geom_text(aes(label=node), hjust=-.3) +
  geom_cladelabel(node= 1384, label='Insecta', offset = 0.5, hjust = 0.5, angle=0,fontsize = 15, color = "black", align = TRUE) +
  geom_cladelabel(node=677, label='Aves', offset = 0.5, hjust = 0.9, angle=0,fontsize = 15, color = "black", align = TRUE)+
  geom_cladelabel(node= 1403, label='Branchiopoda', offset = 0, hjust = 1, angle=0,fontsize = 15, color = "black", align = TRUE)+
  annotate("text", color = "black", x = 7.75, y = 477, size = 20, label = "Reptilia", angle = (133))+
  annotate("text", color = "black", x = 7.75, y = 470, size = 20, label = "Nuda", angle = (133))+
  scale_color_manual(values = c("#89272d", "#d81f2a", "#ff9900" ,"#efe88c", "#00a932"),
  labels = c("Aves", "Insects", "Branchiopoda","Reptiles", "Nudo"))
lizzieinvancouver commented 1 year ago

@MoralesCastilla I asked Deirdre for her code on this in case it helps. We should add something at clade level for the ms figure 1. (I know you mentioned this before, so you may already have a good idea of how to do it, but in case this helps....)