scikit-bio tree#

This example shows how to use iplotx to plot trees from skbio or scikit-bio.

from io import StringIO
from skbio import TreeNode
import iplotx as ipx

tree = TreeNode.read(
    StringIO(
        "((),((),(((),()),((),()))));",
    )
)
ipx.plotting.tree(
    tree,
    layout="radial",
    aspect=1,
    edge_color="purple",
)
plot skbio tree
<iplotx.tree.TreeArtist object at 0x7dd1a5d22990>

iplotx can compute a standard rectangular tree layout as well, and usual style modifications work for trees same as networks:

ipx.plotting.tree(
    tree,
    style=[
        "tree",
        {
            "edge": {
                "color": "deeppink",
                "linewidth": 4,
            },
        },
    ],
)
plot skbio tree
<iplotx.tree.TreeArtist object at 0x7dd1fb788410>

Total running time of the script: (0 minutes 0.379 seconds)

Gallery generated by Sphinx-Gallery