def layout(node): if node.is_leaf(): ####################################################### #~ Taxon Label Size and Margin Adjustment N = AttrFace("name", fsize=1200, fgcolor="#000000") N.margin_top = 250 N.margin_right = 100 #outside N.margin_left = 1000 #inside N.margin_bottom = 250 ####################################################### ####################################################### #~ Taxon Label Background Color Setting tmp = "<myTaxaonLabel>" #~ if not(node.name.find(tmp)) : N.background.color="#FF9999" ####################################################### faces.add_face_to_node(N, node, 0, position="aligned") if (not node.is_leaf()): S = faces.AttrFace("support", fsize=200, fgcolor="#000000") S.margin_top = 20 S.margin_right = 10 S.margin_left = 20 S.margin_bottom = 20 faces.add_face_to_node(S, node, column=0, position="float") if "support" in node.features: # Creates a sphere face whose size is proportional to node's # feature "weight" C = CircleFace(radius=node.support * 20, color="RoyalBlue", style="sphere") # Let's make the sphere transparent C.opacity = 0.3 # And place as a float face over the tree faces.add_face_to_node(C, node, position="float", column=1) style = NodeStyle() style["size"] = 0 style["vt_line_width"] = 150 style["hz_line_width"] = 150 style["vt_line_type"] = 0 # 0 solid, 1 dashed, 2 dotted style["hz_line_type"] = 0 node.set_style(style) bgcol1 = "#FFCCCC" bgcol2 = "#FFE5CC" bgcol3 = "#FFFFCC" bgcol4 = "#E5FFCC" bgcol5 = "#CCFFCC" bgcol6 = "#CCFFE5" bgcol7 = "#FFCCE5" bgcol8 = "#CCFFFF" bgcol9 = "#CCE5FF" bgcol10 = "#CCCCFF" bgcol11 = "#E5CCFF"
def layout(node): if node.is_leaf(): ####################################################### #~ Taxon Label Size and Margin Adjustment N = AttrFace("name", fsize=1200,fgcolor="#000000") N.margin_top = 250 N.margin_right = 100 #outside N.margin_left = 1000 #inside N.margin_bottom = 250 ####################################################### ####################################################### #~ Taxon Label Background Color Setting tmp = "<myTaxaonLabel>" #~ if not(node.name.find(tmp)) : N.background.color="#FF9999" ####################################################### faces.add_face_to_node(N, node, 0, position="aligned") if (not node.is_leaf()) : S=faces.AttrFace("support", fsize=200, fgcolor="#000000") S.margin_top = 20 S.margin_right = 10 S.margin_left = 20 S.margin_bottom = 20 faces.add_face_to_node( S, node, column=0 , position = "float") if "support" in node.features: # Creates a sphere face whose size is proportional to node's # feature "weight" C = CircleFace(radius=node.support*20, color="RoyalBlue", style="sphere") # Let's make the sphere transparent C.opacity = 0.3 # And place as a float face over the tree faces.add_face_to_node(C, node, position="float",column=1) style = NodeStyle() style["size"] = 0 style["vt_line_width"] = 150 style["hz_line_width"] = 150 style["vt_line_type"] = 0 # 0 solid, 1 dashed, 2 dotted style["hz_line_type"] = 0 node.set_style(style) bgcol1="#FFCCCC" bgcol2="#FFE5CC" bgcol3="#FFFFCC" bgcol4="#E5FFCC" bgcol5="#CCFFCC" bgcol6="#CCFFE5" bgcol7="#FFCCE5" bgcol8="#CCFFFF" bgcol9="#CCE5FF" bgcol10="#CCCCFF" bgcol11="#E5CCFF"
def my_layout(node): style2 = NodeStyle() style2["fgcolor"] = "#000000" style2["shape"] = "circle" # style2["vt_line_color"] = "#0000aa" # style2["hz_line_color"] = "#0000aa" # style2["vt_line_width"] = 2 # style2["hz_line_width"] = 2 # style2["vt_line_type"] = 1 # 0 solid, 1 dashed, 2 dotted # style2["hz_line_type"] = 1 node.img_style = style2 node.img_style["bgcolor"] = "LightSteelBlue" if node.is_leaf(): # If terminal node, draws its name # name_faces = AttrFace("name") node.img_style["size"] = 40 # node.img_style["shape"] = "sphere" node.img_style["fgcolor"] = "#FFFFFF" # node.img_style["fgcolor"] = "#9db0cf" # node.img_style["bgcolor"] = "#9db0cf" # node.img_style["faces_bgcolor"] = "#9db0cf" # node.img_style["bgcolor"] = "#9db0cf" # node.img_style["bgcolor"] = "#9db0cf" pass else: # If internal node, draws label with smaller font size # name_faces = AttrFace("name", fsize=15) # Adds the name face to the image at the preferred position # faces.add_face_to_node(name_faces, node, column=0, position="branch-top") # tempo = faces.ImgFace(plot_folder + "/" + node.name + '.jpg') # faces.add_face_to_node(tempo, node, column=0, position="branch-bottom") node.img_style["size"] = 40 node.img_style["shape"] = "sphere" node.img_style["fgcolor"] = "#FFFFFF" tempt = AttrFace('name', fsize=80) tempt.fgcolor = "Black" tempt.margin_top = 10 tempt.margin_right = 10 tempt.margin_left = 10 tempt.margin_bottom = 10 tempt.opacity = 0.5 # from 0 to 1 tempt.inner_border.width = 1 # 1 pixel border tempt.inner_border.type = 1 # dashed line tempt.border.width = 1 # tempt.background.color = "LightGreen" # tempt.penwidth = 40 node.add_face(tempt, column=0, position="branch-top")
def my_layout(node): style2 = NodeStyle() style2["fgcolor"] = "#000000" style2["shape"] = "circle" node.img_style = style2 node.img_style["bgcolor"] = "LightSteelBlue" if node.is_leaf(): node.img_style["size"] = 40 node.img_style["fgcolor"] = "#FFFFFF" pass else: node.img_style["size"] = 40 node.img_style["shape"] = "sphere" node.img_style["fgcolor"] = "#FFFFFF" tempt = AttrFace('name', fsize=80) tempt.fgcolor = "Black" tempt.margin_top = 10 tempt.margin_right = 10 tempt.margin_left = 10 tempt.margin_bottom = 10 tempt.opacity = 0.5 # from 0 to 1 tempt.inner_border.width = 1 # 1 pixel border tempt.inner_border.type = 1 # dashed line tempt.border.width = 1 node.add_face(tempt, column=0, position="branch-top") tempt = AttrFace('alias', fsize=80) tempt.fgcolor = "Black" tempt.margin_top = 10 tempt.margin_right = 10 tempt.margin_left = 10 tempt.margin_bottom = 10 tempt.opacity = 0.5 # from 0 to 1 tempt.inner_border.width = 1 # 1 pixel border tempt.inner_border.type = 1 # dashed line tempt.border.width = 1 node.add_face(tempt, column=0, position="branch-bottom")