I just started using ete3
and it is awesome.
How can I color the leaves of an ete3
Tree object using a color dictionary? I made "c":None
because I don't want the of c
to show up.
I want to have better control of the tree render but I can't figure out exactly how to do it.
I saw that there are NodeStyle
objects but I think this is for the actual nodes. It looks like this TextFace
object is what I need but I don't know how to use it. All the examples are adding labels.
# Build Tree
tree = ete3.Tree( "((a,b),c);" )
# Leaf mapping
D_leaf_color = {"a":"r", "b":"g","c":None}
# Set up style for circular tree
ts = ete3.TreeStyle()
ts.mode = "c"
# Draw Tree
tree.render("tree_test.png", dpi=300, w=500, tree_style=ts)
I looked at this question but it was pretty confusing: How to color tree nodes with fixed set of colors?