Skip to content

Commit 7813a26

Browse files
author
niki_main
committed
added alter_internal_nodes function to make sure that internal nodes won't alter the y axis scale.
1 parent 61e0390 commit 7813a26

3 files changed

Lines changed: 249 additions & 72 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ test_tmp/
2222
# Coverage files
2323
.coverage
2424
htmlcov/
25+
.idea/workspace.xml
26+
bash_colors.sh
27+
.idea/ete.iml
28+
.idea/misc.xml
29+
.idea/modules.xml
30+
.idea/vcs.xml

ete3/treeview/main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def __setitem__(self, i, v):
248248
#def clear(self):
249249
# super(NodeStyle, self).__setitem__("_faces", {})
250250

251+
251252
class TreeStyle(object):
252253
""".. versionadded:: 2.1
253254
@@ -362,6 +363,14 @@ class TreeStyle(object):
362363
:param True show_scale: Include the scale legend in the tree
363364
image
364365
366+
:param False y_axis['show']: Include calculated y scale legend in the tree
367+
image (relative branch length)
368+
369+
:param linear y_axis['scale_type']: Defined the type of the y_axis scale log/linear
370+
371+
:param 1 y_axis['scale_length']: Sets the length of the y_axis scale
372+
(recomended to set to: root.get_farthest_leaf()[1], the depth of the farthest leaf)
373+
365374
:param None scale_length: Scale length to be used as reference scale bar
366375
when visualizing tree. None = automatically adjusted.
367376
@@ -528,6 +537,12 @@ def __init__(self):
528537
self.show_scale = True
529538
self.scale_length = None
530539

540+
# Draw Y_axis scale
541+
self.y_axis = dict()
542+
self.y_axis['show'] = False
543+
self.y_axis['scale_type'] = 'linear'
544+
self.y_axis['scale_length'] = 1
545+
531546
# Initialize aligned face headers
532547
self.aligned_header = FaceContainer()
533548
self.aligned_foot = FaceContainer()

0 commit comments

Comments
 (0)