I'd like to change the orientation of font faces on the output image that is produced by ETE Toolkit: http://etetoolkit.org
For some reason rotation and orientation change does not affect to labels as seen on the picture below:
Code to produce this example on the Jupiter notebook is following:
from ete3 import Tree, TreeStyle
def draw_ete(newick):
t = Tree(newick)
ts = TreeStyle()
ts.scale = 5
ts.rotation = -90
ts.orientation = 1
return t.render("%%inline", tree_style=ts)
newick = """((p, e, a, s, ((e, _), p, o), r, r, i, d, g, (e, _)), (h, o, t), ((,, ↵), (p, e, a, s, ((e, _), p, o), r, r, i, d, g, (e, _))), (c, (o, l, d)), ((,, ↵), (p, e, a, s, ((e, _), p, o), r, r, i, d, g, (e, _))), ((i, n), _, t, h, ((e, _), p, o), t, (,, ↵), n, (i, n), (e, _), d, a, y, s, _, (o, l, d), .), ↵, ↵, (s, o, m, (e, _), l, i, k, (e, _), i, t, _), (h, o, t), ((,, ↵), (s, o, m, (e, _), l, i, k, (e, _), i, t, _)), (c, (o, l, d)), ((,, ↵), (s, o, m, (e, _), l, i, k, (e, _), i, t, _)), ((i, n), _, t, h, ((e, _), p, o), t, (,, ↵), n, (i, n), (e, _), d, a, y, s, _, (o, l, d), .));"""
draw_ete(newick)
I would also like to know if it is possible to split the output to multiple rows instead of one line? Long sequences tend to take huge width space so it would be practical to get sequence split on several lines.
answer from the etetoolkit mailing list:
1) rotation is possible by using custom layouts and TextFaces. Check this example:
2) split on several lines: I don't fully understand your question but, if asking about reducing the width of the final tree image, the only way would be to split the drawing in multiple render calls, one per node that you want to draw. For instance. To split one tree into two independent images, you could run:
3) You mean the branch scale at bottom? You can set
TreeStyle.show_scale=False