How to plot this picture use matlab?
Show older comments
Accepted Answer
More Answers (1)
Ameer Hamza
on 20 May 2020
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 Comments
z cy
on 21 May 2020
Ameer Hamza
on 21 May 2020
Do you have the adjacency matrix for your graphs?
z cy
on 21 May 2020
Ameer Hamza
on 21 May 2020
Edited: Ameer Hamza
on 21 May 2020
Do you have the code to create the adjacency matrix? Also, do you want to use custom coordinates for the node position?
z cy
on 23 May 2020
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!