How to plot 4 nodes in a weighted digraph as a square?
Afficher commentaires plus anciens
I am trying to control the layout of a digraph consisting of two pairs of nodes so the graph looks something like this:
node1_pair1 <-> node1_pair2
node2_pair1 <-> node2_pair2
I would like the two pairs to be arranged in a square, with either pair showing weighted connections to the other. When there are only "horizontal connections" (e.g. node1_pair1 -> node1_pair2), I am able to retain a square arrangement of nodes by using the layout function:
layout(p,'layered','direction','right');'
However, when I try to add a "diagonal" connection (e.g. node1_pair1 -> node2_pair2) or vertical connection, the nodes lose their square arrangemnt. How can I retain a square arrangement of nodes regardless of the connections I add?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graph and Network Algorithms dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!