

ImgFace ( img_path + "mouse.png" ) dogFace = faces.

ImgFace ( img_path + "human.png" ) mouseFace = faces. root_opening_factor = 1 return t, ts if _name_ = "_main_" : t, ts = get_example_tree () #t.render("node_background.png", w=400, tree_style=ts) t. add_face_to_node ( N, node, 0, position = "aligned" ) def get_example_tree (): # Set dashed blue lines in all leaves nst1 = NodeStyle () nst1 = "LightSteelBlue" nst2 = NodeStyle () nst2 = "Moccasin" nst3 = NodeStyle () nst3 = "DarkSeaGreen" nst4 = NodeStyle () nst4 = "Khaki" t = Tree ( "((((a1,a2),a3), ((b1,b2),(b3,b4))), ((c1,c2),c3)) " ) for n in t. is_leaf (): N = AttrFace ( "name", fsize = 30 ) faces.

show ( tree_style = ts ) #t.render("node_style.png", w=400, tree_style=ts)įrom ete3 import Tree, faces, AttrFace, TreeStyle, NodeStyle def layout ( node ): if node. show_leaf_name = False return t, ts if _name_ = "_main_" : t, ts = get_example_tree () t. img_style = style1 # Set dashed blue lines in all leaves style2 = NodeStyle () style2 = "#000000" style2 = "circle" style2 = "#0000aa" style2 = "#0000aa" style2 = 2 style2 = 2 style2 = 1 # 0 solid, 1 dashed, 2 dotted style2 = 1 for l in t.

set_style ( style ) #Set dotted red lines to the first two branches style1 = NodeStyle () style1 = "#0f0f0f" style1 = 0 style1 = "#ff0000" style1 = "#ff0000" style1 = 2 style1 = 2 style1 = 2 # 0 solid, 1 dashed, 2 dotted style1 = 2 t. You # can now create fixed node styles and use them many times, save them # or even add them to nodes before drawing (this allows to save and # reproduce an tree image design) # Set bold red branch to the root node style = NodeStyle () style = "#0f0f0f" style = 0 style = "#ff0000" style = "#ff0000" style = 8 style = 8 style = 0 # 0 solid, 1 dashed, 2 dotted style = 0 t. populate ( 8 ) # Node style handling is no longer limited to layout functions. add_face_to_node ( AttrFace ( "name" ), node, column = 0 ) def get_example_tree (): t = Tree () t.
