How to plot this picture use matlab?
显示 更早的评论
采纳的回答
更多回答(1 个)
Ameer Hamza
2020-5-20
Try this code
s = randi([1 100], 1, 2000);
t = randi([1 100], 1, 2000);
G = graph(s, t);
p = plot(G, 'Layout', 'subspace');
p.NodeLabel = [];
p.MarkerSize = 10;
p.NodeCData = 1:100;
p.EdgeColor = [0.5 0.5 0.5];
colormap(autumn)
colorbar

5 个评论
z cy
2020-5-21
Ameer Hamza
2020-5-21
Do you have the adjacency matrix for your graphs?
z cy
2020-5-21
Ameer Hamza
2020-5-21
编辑:Ameer Hamza
2020-5-21
Do you have the code to create the adjacency matrix? Also, do you want to use custom coordinates for the node position?
z cy
2020-5-23
类别
在 帮助中心 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
