Digraph node label threshold

4 次查看(过去 30 天)
For (di)graphs with greater than 100 nodes the nodes are no longer labeled when plotted. Is there a way to change this threshold? Force labeling?

采纳的回答

Steven Lord
Steven Lord 2021-4-22
Is there a way to change this threshold?
No.
Force labeling?
Yes.
D = digraph(sprand(150, 150, 0.1));
h = plot(D); % No labels
figure
h = plot(D);
h.NodeLabelMode = 'auto';
Or if you want to label only a few nodes see the labelnode function.
figure
h = plot(D);
nodesToLabel = 1:30:numnodes(D);
labelnode(h, nodesToLabel, string(nodesToLabel))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by