Connect nodes and edges with different layout
2 次查看(过去 30 天)
显示 更早的评论
Hi, I create a adjacency matrix, in the form: http://yed.yworks.com/wp-content/uploads/2011/08/format_adjacencymatrix1.png
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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Construction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!