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

1 view (last 30 days)
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.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!