Produce a graph of tree or forest.
The first argument is vector of predecessors.
The optional parameters node_style and edge_style define the output plot style.
The complexity of the algorithm is O(n) in terms of is time and memory requirements.
See also: etreeplot, gplot.
The following code
clf; treeplot ([2 4 2 0 6 4 6]); % Plot a simple tree plot
Produces the following figure
Figure 1 |
---|
The following code
clf; treeplot ([2 4 2 0 6 4 6], "b+", "g"); % Plot a simple tree plot defining the edge and node styles
Produces the following figure
Figure 1 |
---|
Package: octave