Dear all,
I am using ETEtoolkit. The python code and the generated PDF file for the tree image are attached. Could anybody help me, how I can change the fontsize of "A, B, C", etc... and How I can rotate this label text to make them horizontal?
Thank you all in advance.
The python file is as follows:
###############################
from ete2 import Tree, TreeStyle, TextFace, NodeStyle, AttrFace, faces
t = Tree("((B,(A,C)Internal_1)Internal_1,(D,F)Internal_1);", format=8)
# Basic tree style
ts = TreeStyle()
ts.show_leaf_name = True
ts.show_scale = False
ts.show_border = True
ts.branch_vertical_margin = 50 # 50 pixels between adjacent branches
ts.rotation = 90
ts.scale = 100 # 100 pixels per branch length unit
ts.title.add_face(TextFace("BS Tree", fsize=10), column=0)
ts.tree_width = 80
# Draws nodes as small red spheres of diameter equal to 10 pixels
nstyle = NodeStyle()
nstyle["shape"] = "sphere"
nstyle["size"] = 10
nstyle["fgcolor"] = "darkred"
nstyle["vt_line_width"] = 2
nstyle["hz_line_width"] = 2
nstyle["vt_line_type"] = 0 # 0 solid, 1 dashed, 2 dotted
nstyle["hz_line_type"] = 0
nstyle["hz_line_color"] = "black"
nstyle["vt_line_color"] = "black"
# Applies the same static style to all nodes in the tree. Note that,
# if "nstyle" is modified, changes will affect to all nodes
for n in t.traverse():
n.set_style(nstyle)
n.dist = 0.2
t.dist = 0.1
t.render("mytree.pdf", h=100, units="mm", tree_style=ts, dpi=200)
###############################
Regards,
Sudip