Closed tahamimo closed 3 years ago
I don't understand the issue or the syntax. Are you trying to plot different color tips (terminal edges) on a plotted tree? Or are you doing something with phylo.to.map? Please try to post a reproducible example so that I can help.
I don't understand the issue or the syntax. Are you trying to plot different color tips (terminal edges) on a plotted tree? Or are you doing something with phylo.to.map? Please try to post a reproducible example so that I can help.
Or in general, if I know how can I change the default "red" colour of the lines to "white" or something invisible then I can manually draw lines myself
Hi Tahamimo. I don't even know which function you're using, so it's difficult for me to respond. Are you plotting the tree of your attached image but your want the terminal edges to have different colors based on the nominal taxon membership of each label?
Hi Liam, This is my complete code:
#convert column 1 to rownames and remove column 1
rownames(gps) <- gps$name
gps <- gps[,2:3]
obj <- phylo.to.map(tree, gps, database="world",
regions="Iran", plot=FALSE)
plot(obj, type="phylogram", direction="rightwards", fsize=0.6)
Are you plotting the tree of your attached image but your want the terminal edges to have different colors based on the nominal taxon membership of each label?
yes, as I explained twice in both of my previous comments, that is my intention
It is possible to draw the linking lines with different colors. To see how, search my blog for the function phylo.to.map
-- e.g., http://blog.phytools.org/search?q=phylo.to.map.
I want to be able to manually assign colours once based on species/population and once based on clades, I tried this for 64 tips:
colours(tree$tip.label) <- c(rep("red", 15), rep("blue", 7), rep("orange", 6), rep("green", 4), rep("purple", 3), rep("white", 13))
but it doesn't work, giving this error:Does anybody know how to manually set colours to each tip?