dolayout(bg, 'Pathsonly', true) produces overlapping edges

3 Ansichten (letzte 30 Tage)
Franziska Wegner
Franziska Wegner am 13 Sep. 2013
Dear Community,
I tried to produce the same layout for the same graph. Which means I have different edge weights but the graph is the same. So I set the node position for the layout as in the example dolayout. That means:
bg = biograph(newGraph)
defaultBg = biograph(defaultGraph);
dolayout(defaultBg); dolayout(bg);
n_v = size(bg.getmatrix,1);
n_e = size(find(bg.getmatrix),1);
if exist('graphLayout.mat', 'file')
load('graphLayout');
end
for counter = 1:n_v
bg.nodes(counter).Position = graphLayout.nodes(counter,2:3);
end
set(bg, 'EdgeType', 'curved');
dolayout(bg, 'Pathsonly', true);
The problem is if I just say dolayout(bg) the nodes are reset to a new position, but the edges are fine. If I only recalculate the paths with dolayout(bg, 'Pathsonly', true) then reciprocal edges are overlapping. Does anyone have an idea to avoid this problem?
Thank you and best regards.

Antworten (0)

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by