Navigation

Operators and Keywords

Function List:

C++ API

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

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.

Demonstration 1

The following code

 clf;
 treeplot ([2 4 2 0 6 4 6]);
 % Plot a simple tree plot

Produces the following figure

Figure 1

Demonstration 2

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