Connect nodes and edges with different layout

2 ビュー (過去 30 日間)
Kyle
Kyle 2012 年 9 月 29 日
so there are 5 nodes (names) and 8 edges (number of 1). the table is read as, for example, Anna and Chris is connected (put 1 there).
I want to use a kind of graphic theory to draw their relationships, so what kind of code I can use? I hope the such network figure is as beautiful as possible, and the size of nodes is a linear relationship with the number of connections, i.e. the more connections to that people, the node of that people is bigger. and also put the name of that people in the node.
Please give me some clues or hints, many thanks
Kyle

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 9 月 29 日
You can use rectangle() [yes, seriously] to draw the circles. You can adjust the size of the circle in the command to draw it. You can text() the name into place in the circle.
Those things are simple, more "housekeeping" than anything else.
The difficult part of your task is that "as beautiful as possible" is going to be very very difficult to achieve. You are going to have to start by inventing ways to measure peoples' "sense of beauty", and then do many many tests to find the most beautiful arrangement possible for humans. And then you are going to have to figure out how to draw that. Mathworks does not offer any toolboxes that allow "beauty" to be measured.

カテゴリ

Help Center および File ExchangeConstruction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by