how to increase node/edge separation within the layer in the layered graph?

4 ビュー (過去 30 日間)
Agnieszka Wegrzyn
Agnieszka Wegrzyn 2021 年 6 月 19 日
回答済み: Christine Tobler 2024 年 6 月 6 日
Hi, I can already generate a decent layered graph showing inputs and outputs for a central node. However, I have not found a way to make the graph increase the separation between the nodes in layer 1 and 3. Is there a way to do it?
  2 件のコメント
Abhinaya Kennedy
Abhinaya Kennedy 2024 年 6 月 6 日
You can manually set the positions of the nodes in layers 1 and 3 using the "NodePositions" property. This gives more control but is more time-consuming.
Also, here are some links that could help:
Christine Tobler
Christine Tobler 2024 年 6 月 6 日
The interactive graph layout link there is nice, and will allow you to pull nodes around with the mouse. Here I suspect you'd prefer using some formula instead, if you want all the nodes to change.

サインインしてコメントする。

回答 (1 件)

Christine Tobler
Christine Tobler 2024 年 6 月 6 日
You can access the XData and YData properties of the GraphPlot object returned by plot, to move the nodes further apart.
Note if your layered layout had any bent edges, these will revert to straight edges as soon as you manually set the XData or YData properties of the nodes. It seems from your example that this isn't likely to be a problem.

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by