next up previous contents index
Next: 3.2.3 Managing Metanet windows Up: 3.2 Using the Metanet Previous: 3.2.1 Showing a graph

3.2.2 Showing arcs and nodes

Another very useful thing to do is to distinguish a set of nodes and/or a set of arcs in the displayed graph. This is done by highlighting nodes and/or arcs: use the show_arcs and show_nodes functions.

The arguments of the show_arcs and show_nodes functions are respectively a row vector of arc numbers (or edge numbers if the graph is undirected) or a row vector of node numbers. These sets of arcs and nodes are highlighted in the current Metanet window. Note that the corresponding graph must be displayed in this window, otherwise the numbers might not correspond to arcs or nodes numbers (see 3.2.3 for changing the current Metanet window).

By default, using one of these functions switch off any preceeding highlighting. If you want to keep preceeding highlighting, use the optional argument 'sup'.

For instance, the following commands displays the graph g and highlights 3 arcs and 2 nodes:

show_graph(g)
show_arcs([1 10 3]); show_nodes([2 7],'sup')

Note that another way to distinguish arcs and nodes in a displayed graph is to give them colors. For that you have to use the elements edge_color and node_color of the graph list (see 1.1). But you have to modify the graph list of the graph and use show_graph again to display the graph with the new colors.


next up previous contents index
Next: 3.2.3 Managing Metanet windows Up: 3.2 Using the Metanet Previous: 3.2.1 Showing a graph
Scilab Group