circular network chart (non-ribbon chord diagram)

Creates a circular graph/network with customisable nodes and edges. Supports multiple rendering methods, group layout, curvature control.

Ahora está siguiendo esta publicación

See new version ~ ~ ~ o(> _ <)o
Basic usage and RenderingMethod
Data = [25, 0, 0, 22, 24, 25, 8, 0, 0;
0, 14, 0, 0, 0, 0, 6, 4, 1;
0, 0, 11, 0, 0, 0, 0, 0, 7;
0, 0, 0, 22, 0, 20, 17, 0, 0;
0, 0, 0, 0, 24, 3, 6, 3, 0;
0, 0, 0, 0, 0, 25, 7, 0, 2;
0, 0, 0, 0, 0, 0, 17, 0, 0;
0, 0, 0, 0, 0, 0, 0, 11, 0;
0, 0, 0, 0, 0, 0, 0, 0, 5];
% Input required: Upper triangular adjacency matrix
% Node radius is mapped from diagonal values;
% edge width is mapped from off‑diagonal values (separate mappings).
%% Basic usage (default RenderingMethod : simple)
figure()
% Create circular network chart object and draw.
CN1 = circNetChart(Data);
CN1 = CN1.draw();
%% Change color (RenderingMethod : interp)
figure()
CList = [127, 91, 93; 187,128,110; 197,173,143; 59, 71,111; 104, 95,126; 76,103, 86;
112,112,124; 72, 39, 24; 197,119,106; 160,126, 88; 238,208,146]./255;
CN2 = circNetChart(Data);
CN2.RenderingMethod = 'interp'; % RenderingMethod : interp
CN2.NodeColor = CList; % Change node color
% CN2.EdgeColor = CList; % Change edge color (Edge color defaults to match node color)
CN2 = CN2.draw();
%% RenderingMethod : map
figure()
CN3 = circNetChart(Data);
CN3.RenderingMethod = 'map'; % RenderingMethod : map (Map values to colors)
CN3 = CN3.draw();
colormap(turbo)
colorbar('FontName','Times New Roman', 'FontSize',15)
Node-Size-Lim and Edge-Width-Lim, Label, Curvature
Data = triu(randi([1, 20], [18, 18]));
%% Node-Size-Lim and Edge-Width-Lim
figure()
CN4 = circNetChart(Data);
% Node radius is mapped from diagonal values;
% edge width is mapped from off‑diagonal values (separate mappings).
% The minimum non‑zero diagonal value maps to the first element of NodeSizeLim,
% and the maximum maps to the second. (The same applies to EdgeWidthLim).
% If the two values of NodeSizeLim are equal,
% all nodes will have the same size. (The same applies to EdgeWidthLim).
CN4.NodeSizeLim = [.05, .05];
CN4.EdgeWidthLim = [.01, .01];
CN4 = CN4.draw();
%% Label rotate and label porperties
figure()
CN5 = circNetChart(Data);
CN5.NodeSizeLim = [.05, .05];
CN5.EdgeWidthLim = [.01, .01];
CN5 = CN5.draw();
% Enable label rotation for better readability.
CN5.labelRotate('on')
% Set global label style: monospaced font, size 15.
CN5.setLabel('FontName', 'Monospaced', 'FontSize',15)
% Customize the 2nd label individually with blue color.
CN5.setLabelN(2, 'Color',[0,0,.8])
%% Curvature (Default : 0.5 | Straight line: 0 | Bezier curve: 1)
figure()
CN6 = circNetChart(Data);
CN6.NodeSizeLim = [.05, .05];
CN6.EdgeWidthLim = [.01, .01];
CN6.Curvature = 0; % Straight line: 0
CN6 = CN6.draw();
figure()
CN7 = circNetChart(Data);
CN7.NodeSizeLim = [.05, .05];
CN7.EdgeWidthLim = [.01, .01];
CN7.Curvature = 1; % Bezier curve: 1
% CN7.NodeColor = turbo(18);
CN7 = CN7.draw();
%% Node name
Data = triu(randi([1, 20], [5, 5]));
figure()
CN8 = circNetChart(Data);
CN8.NodeName = {'AAA','BBB','CCC','DDD','EEE'}; % Change node name
CN8 = CN8.draw();
Group
Data = triu(randi([1, 20], [40, 40]));
Data((rand(40) + eye(40)) < .9) = 0;
% Define node groups
Group = [ones(1,5), ones(1,5).*2, ones(1,8).*3, ones(1,12).*4, ones(1,8).*5, 1, 1];
groupName = {'Set-AAA','Set-BBB','Set-CCC','Set-DDD','Set-EEE'};
% CList = [127, 91, 93; 187, 128, 110; 197, 173, 143; 59, 71, 111; 104, 95, 126]./255;
CList = [78, 101, 155; 138, 140, 191; 184, 168, 207; 231, 188, 198; 253, 207, 158]./255;
%% Group
figure()
CN9 = circNetChart(Data);
CN9.NodeSizeLim = [.03, .03];
CN9.EdgeWidthLim = [.01, .01];
CN9.Curvature = .8;
CN9.NodeColor = CList(Group, :); % Color nodes by group membership
CN9.RenderingMethod = 'interp'; % RenderingMethod : interp
% Group layout settings
CN9.Group = Group; % Group assignment for each node
CN9.GroupSep = 1/4; % Group gaps occupy 1/4 of the circle
% CN9.GroupName = groupName;
% CN9.GroupLabelRadius = 1.35;
CN9 = CN9.draw();
% Enable label rotation for better readability.
CN9.labelRotate('on')
% Set global label style: monospaced font, size 12.
CN9.setLabel('FontName', 'Monospaced', 'FontSize',12)
% % Set global group label style: monospaced font, size 21.
% CN9.setGroupLabel('FontName', 'Monospaced', 'FontSize',21)
% Create legend for each group
[~, ind] = unique(Group);
legend(CN9.nodeHdl(ind), groupName, 'FontName', 'Monospaced', 'FontSize',12, 'Location','best')
A demo (Pi digit connectivity visualization)
%% Pi digit connectivity visualization (digits 1-1000)
% First 1000 digits of pi after decimal point
piStr = ['1415926535897932384626433832795028841971693993751058209749445923078', ...
'1640628620899862803482534211706798214808651328230664709384460955058', ...
'1723175359408128481117450284102701938521105559644622948954930381964', ...
'4288109756659334461284756482337867831652712019091456485669234603486', ...
'1045432664821339360726024914127372458700660631558817488152092096282', ...
'9254091715364367892590360011330530548820466521384146951941511609433', ...
'0572703657595919530921861173819326117931051185480744623799627495673', ...
'5188575272489122793818301194912983367336244065664308602139494639522', ...
'4737190702179860943702770539217176293176752384674818467669405132000', ...
'5681271452635608277857713427577896091736371787214684409012249534301', ...
'4654958537105079227968925892354201995611212902196086403441815981362', ...
'9774771309960518707211349999998372978049951059731732816096318595024', ...
'4594553469083026425223082533446850352619311881710100031378387528865', ...
'8753320838142061717766914730359825349042875546873115956286388235378', ...
'75937519577818577805321712268066130019278766111959092164201999'];
% Convert digit characters to group indices (1-10)
% Subtract 47 to map ASCII '0' (48) to group 1
Group = abs(piStr(1:1000)) - 47;
% Build adjacency matrix: connect each digit to its next neighbor (off-diagonal)
Data = diag(ones(1, 999), -1);
% Sort nodes by group for grouped layout
[Group, ind] = sort(Group);
Data = Data(ind, ind); % Reorder adjacency matrix
Data = Data + Data.' + eye(1000); % Make symmetric and add self-loops
% Define group (digit) names and custom colors
groupName = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
colorList = [239, 65, 75; 230, 115, 48; 229, 158, 57; 232, 136, 85; 239, 199, 97;
144, 180, 116; 78, 166, 136; 81, 140, 136; 90, 118, 142; 43, 121, 159] ./ 255;
% Create figure with black background
figure()
set(gca, 'Color', [0, 0, 0])
% Initialize circular network chart
CNPI = circNetChart(Data);
% Node and edge appearance (uniform sizes)
CNPI.NodeSizeLim = [0.01, 0.01];
CNPI.EdgeWidthLim = [0.005, 0.005];
% Group layout configuration
CNPI.Group = Group;
CNPI.GroupSep = 1/8; % Gap between groups (1/8 of full circle)
CNPI.GroupName = groupName;
CNPI.GroupLabelRadius = 1.05;
% RenderingMethod : interp
CNPI.NodeColor = colorList(Group, :);
CNPI.RenderingMethod = 'interp';
% Edge curvature (full Bezier curve)
CNPI.Curvature = 1;
% Render the chart
CNPI = CNPI.draw();
% Hide individual node labels
CNPI.setLabel('Visible', 'off')
% Style group labels (digit labels around the circle)
CNPI.setGroupLabel('FontSize', 25, 'FontName', 'Monospaced', ...
'FontWeight', 'bold', 'Color', 'w')

Citar como

Zhaoxu Liu / slandarer (2026). circular network chart (non-ribbon chord diagram) (https://es.mathworks.com/matlabcentral/fileexchange/118655-circular-network-chart-non-ribbon-chord-diagram), MATLAB Central File Exchange. Recuperado .

Información general

Compatibilidad con la versión de MATLAB

  • Compatible con cualquier versión

Compatibilidad con las plataformas

  • Windows
  • macOS
  • Linux
Versión Publicado Notas de la versión Action
2.1.1

Change summary and cover

2.1.0

Debug.

2.0.1

Fixed an error that occurred when all diagonal entries of the matrix were zero.

2.0.0

See new version.

1.0.0