graphplot graph: How to fix several node positions?

2 ビュー (過去 30 日間)
Kip
Kip 2016 年 12 月 19 日
I have a connected graph of ~30 nodes and ~100 connections. I uploaded an example. I have a 'central few' of ~8 labeled nodes, and want those to be centrally located. (PS: I want to do this programmatically, not by hand).
  • Q1) How might I glue down the position of the central nodes, then let 'force' redistribute the rest?
If I edit XData(1:8) and YData(1:8) after plot(G,..,'force'), those nodes look clearly out of place. I tried a loop feeding the old XData into the new XStart, but even 'iterations' = 1 was enough for those nodes to jump away.
  • Q2) Is it possible to 'weight' nodes differently than just # of edges (ie, assign some inertia) during the iterations?
I wouldn't mind trying to do the whole XData/YData iteration process in a script, so I can try options out myself.
  • Q3) Does anyone have a force-directed optimizing routine that mimics plot(G,..'force')? My searches went unsuccessful.
FYI: I'm a smart guy, but I'm no theoretical mathematician. :(

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by