spineNetworkPlot
Draw a network with its nodes coloured by score.
The natural pairing is the degree measure with "upper", where the hubs are the atypical nodes. Nodes are sized by degree so hubs read as hubs, and drawn in increasing order of score so they are never buried. Edges are kept faint: the point is which nodes stand out, not the wiring.
Syntax and options
help spineNetworkPlot
SPINE Network Plot
Draw a network with its nodes coloured by SPINE score.
fig = spineNetworkPlot(Result, A)
fig = spineNetworkPlot(Result, A, 'Title', 'my graph', 'LabelTop', 5)
A is the symmetric adjacency matrix the run was built from, and Result is what
spineRun returned for it. The natural pairing is the degree measure with the
"upper" orientation, where the hubs are the atypical nodes.
Nodes are laid out by a force-directed layout, drawn in increasing order of
score so the atypical ones sit on top, and sized by degree so hubs read as
hubs. Edges are kept faint: the point of the figure is which nodes stand out,
not the wiring.
Options
'Width' figure width in millimetres (default 150)
'Height' figure height in millimetres (default 138)
'Title' text above the axes
'ColourBy' "score" (default) or "stratum", as in spineDataPlot
'Layout' any layout accepted by graph/plot (default "force")
'Seed' seed for the layout, which is stochastic (default 0)
'LabelTop' label the N highest-degree flagged nodes (default 0)
'EdgeAlpha' edge transparency (default 0.12)
Uses base MATLAB only. graph and its force layout are core MATLAB.
Author
Abd AlRahman AlMomani
Assistant Professor of Data Science and Mathematics, ERAU, AZ
almomaniar@gmail.com
Hubs in a small-world network
A ring lattice with a few shortcuts, plus five nodes wired to a fifth of the network each.
t = mod(i+j-1, n) + 1; W(i,t) = 1; W(t,i) = 1;
v = n + h; targets = randperm(n, round(0.2*n));
W(v, targets) = 1; W(targets, v) = 1;
[s, R] = spine(W, 'degree', "upper");
fprintf('%d nodes, %d strata, %d flagged as hubs\n', size(W,1), R.nStrata, sum(s > 0));
125 nodes, 2 strata, 5 flagged as hubs
spineNetworkPlot(R, W, 'Title', 'designated hubs', 'Seed', 3);
A network with no hubs
One stratum, nothing flagged. That is a property of the network: these degrees sit at a single scale.
[sf, Rf] = spine(Wflat, 'degree', "upper");
fprintf('degrees %d to %d, %d stratum, %d flagged\n', ...
min(sum(Wflat,2)), max(sum(Wflat,2)), Rf.nStrata, sum(sf > 0));
degrees 6 to 6, 1 stratum, 0 flagged
The layout is seeded
A force layout is stochastic, so 'Seed' makes the picture repeatable. It changes only the arrangement, never the partition.
See also
spine with the degree measure, spineDataPlot for point data.