MATLAB Answers

graphplot graph: How to fix several node positions?

8 views (last 30 days)
Kip on 19 Dec 2016
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. :(


Sign in to comment.

Answers (0)

Translated by