adds disconnected nodes to a graph
g1 = add_node(g [,xy] [,name]])
graph list (see graph_data_structure).
optional new nodes coordinates, can be a 2 vector or a matrix with two rows [x;y]
.
optional vector of strings, names of the added nodes
graph list of the new graph with the added nodes
add_node
adds disconnected nodes to graph g
and returns the new
graph g1
.
The coordinates of the new nodes can be given as a vector of
coordinates in xy
. If the nodes of graph
g
have no coordinates (elements
g.nodes.graphics.x
and
g.nodes.graphics.y
are []
),
to give xy
has no effect. If the nodes of graph
g
have coordinates and xy
is
not given, the new node has (0,0)
as
coordinates.
If name
is given, it is the vector of the new node names, otherwise the node number
is taken as the name of each new node.
add_node
initializes the node graphic properties to their default values.