How to plot this picture use matlab?
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Steven Lord
2020-5-21
On the documentation page for the plot method of graph objects see the "Custom Graph Node Coordinates" example for how to plot nodes of your graph in specific locations.
The documentation page describing various types of customization you can do to a plotted graph may also be of use to you.
更多回答(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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/295308/image.png)
5 个评论
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?
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!