setNodeLineColor (networkvisualizer)

index

setNodeLineColor (networkvisualizer)

Set the line colors of nodes for a networkvisualizer object.

Syntax

net = setNodeLineColor(net, RGB)
net = setNodeLineColor(net, values)
net = setNodeLineColor(net, values, categories)
net = setNodeLineColor(net, values, categories, classname)

Arguments

Description

Examples

Setting the node line colors randomly

%% Run networkvisualizer on a random network
rng(1, 'twister'); % For reproducibility
W = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
net = networkvisualizer(W);
net.setNodeLineWidth(5);
% Set the node line colors randomly to one of default colors
defaultcolors = net.getDefaultColors();
colors = defaultcolors(randi([1 3], length(W), 1), :);
net.setNodeLineColor(colors);
% Plot the network
plot(net);

which produces:

See Also

networkvisualizer, addNodeClass, setNodeLineWidth, setNodeLineStyle