Skip to content

treeplot

sparse · scripts/sparse/treeplot.m

: treeplot (tree)
: treeplot (tree, node_style, edge_style)

Draw a tree or forest from its parent vector.

tree is a row vector in which element k holds the index of the parent of node k, or 0 when node k is a root. The layout comes from treelayout.

node_style and edge_style are line specifications, as used by plot, for the node markers and the connecting lines.

Time and memory grow linearly with the number of nodes.