graphplot graph: How to fix several node positions?
3 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!