Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
jordibc committed Oct 24, 2023
1 parent ed1186f commit d2ea154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/tutorial/tutorial_drawing.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. currentmodule:: ete4.treeview

Programmable Tree Drawing
Programmable tree drawing
=========================

.. contents::
Expand Down
16 changes: 8 additions & 8 deletions examples/treeview/node_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -15,42 +15,42 @@ 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
style['vt_line_color'] = '#ff0000'
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
style1['vt_line_color'] = '#ff0000'
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'
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['vt_line_type'] = 1 # 0 solid, 1 dashed, 2 dotted
style2['hz_line_type'] = 1
for l in t.leaves():
l.img_style = style2
Expand Down

0 comments on commit d2ea154

Please sign in to comment.