Note
Go to the end to download the full example code.
Split edges#
This example shows how to use split edges, i.e. how to apply different styles to
tree edges that are composed of multiple segments. See also Zero-dependency trees
for the basic example of how to plot a tree with iplotx’s internal tree representation.
Note
The current implementation only supports two-piece edges.

<iplotx.tree.TreeArtist object at 0x7af38ff234d0>
from collections import defaultdict
import matplotlib.pyplot as plt
import iplotx as ipx
tree = {
"children": (
{},
{
"children": (
{
"children": (
{},
{}
)
},
{
"children": (
{},
{}
)
}
)
}
)
}
tree = ipx.ingest.providers.tree.simple.SimpleTree.from_dict(tree)
ipx.tree(
tree,
style="tree",
edge_split_linestyle=":",
edge_split_color=defaultdict(lambda: "k", {tree.children[1]: "red"}),
)
Total running time of the script: (0 minutes 0.031 seconds)