Generate a digraph object (you'll need to know which nodes should be connected by edges) and plot it. When you plot the digraph, you can specify the XData and YData properties to control exactly where the nodes are plotted. The example "Custom Graph Node Coordinates" in the documentation shows this technique.
Graph Plot Layout Variation
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a graph with many nodes and I have plot them according to their frequency.
scatter(nodes,freq);
Here is obtained image of plot
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164866/image.png)
Now I need to create a directed graph on that plot without changing the position of the node.
I can draw it by plotting lines according to the edges but there is a problem in plotting arrow in mid of line & also how to consider multiple edges and loops.
The problem can look as we have to change the layout of the graph such that all nodes are aligned according to X-axis label and the height of each node is to be varied according to the frequency of that node.
If there is some direct function available that will be more appreciated.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 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!