Graph Plot Layout Variation
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Steven Lord
le 5 Juin 2017
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!