diff --git a/doc/tutorial/tutorial_drawing.rst b/doc/tutorial/tutorial_drawing.rst index 866e8bcdb..5249bdc3a 100644 --- a/doc/tutorial/tutorial_drawing.rst +++ b/doc/tutorial/tutorial_drawing.rst @@ -1,6 +1,6 @@ .. currentmodule:: ete4.treeview -Programmable Tree Drawing +Programmable tree drawing ========================= .. contents:: diff --git a/examples/treeview/node_style.py b/examples/treeview/node_style.py index 80dea179e..01327f4e3 100755 --- a/examples/treeview/node_style.py +++ b/examples/treeview/node_style.py @@ -3,7 +3,7 @@ def layout(node): - # If node is a leaf, add the nodes name and a its scientific name + # If node is a leaf, add the nodes name and a its scientific name. if node.is_leaf: faces.add_face_to_node(AttrFace('name'), node, column=0) @@ -15,9 +15,9 @@ def get_example_tree(): # Node style handling is no longer limited to layout functions. 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) + # reproduce an tree image design). - # Set bold red branch to the root node + # Set bold red branch to the root node. style = NodeStyle() style['fgcolor'] = '#0f0f0f' style['size'] = 0 @@ -25,11 +25,11 @@ def get_example_tree(): style['hz_line_color'] = '#ff0000' style['vt_line_width'] = 8 style['hz_line_width'] = 8 - style['vt_line_type'] = 0 # 0 solid, 1 dashed, 2 dotted + style['vt_line_type'] = 0 # 0 solid, 1 dashed, 2 dotted style['hz_line_type'] = 0 t.set_style(style) - #Set dotted red lines to the first two branches + # Set dotted red lines to the first two branches. style1 = NodeStyle() style1['fgcolor'] = '#0f0f0f' style1['size'] = 0 @@ -37,12 +37,12 @@ def get_example_tree(): style1['hz_line_color'] = '#ff0000' style1['vt_line_width'] = 2 style1['hz_line_width'] = 2 - style1['vt_line_type'] = 2 # 0 solid, 1 dashed, 2 dotted + style1['vt_line_type'] = 2 # 0 solid, 1 dashed, 2 dotted style1['hz_line_type'] = 2 t.children[0].img_style = style1 t.children[1].img_style = style1 - # Set dashed blue lines in all leaves + # Set dashed blue lines in all leaves. style2 = NodeStyle() style2['fgcolor'] = '#000000' style2['shape'] = 'circle' @@ -50,7 +50,7 @@ def get_example_tree(): 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['vt_line_type'] = 1 # 0 solid, 1 dashed, 2 dotted style2['hz_line_type'] = 1 for l in t.leaves(): l.img_style = style2