How to plot 4 nodes in a weighted digraph as a square?
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!