How can I reverse an edge in biograph viewer without redrawing the figure?

조회 수: 1 (최근 30일)
Anurag
Anurag 2013년 4월 13일
I can use the following code to generate a biograph figure and use the handle to directly change the properties of the figure in the Biograph Viewer:
A = [0 1; 0 0]
h=view(biograph(A))
set(h.Nodes,'Color',[.5 .7 1])
Similarly, is there a way to use the handle 'h' to reverse the edge (1,2)? I want to use this code to animate the edge reversal so creating another A matrix and redrawing the biograph is not an option.
When I modified the Nodes properties (like the example code, or the node id), the changes were seen immediately in the Biograph Viewer. However, when I make changes to the edge properties, nothing happens.

답변 (1개)

Lucio Cetto
Lucio Cetto 2013년 5월 6일
You must call the layout engine to redraw graph. This is because in some types of layouts the actual chronological order of the nodes drives the final position of the nodes. However if you are satisfied with the position of the nodes, you may call the dolayout method with the 'PathsOnly' option set to TRUE. This will redraw the edges, leaving the nodes at their current position. If you follow this approach you will need to tune the Scale and LayoutScale if you want to have extra space between the edges and nodes, as the initial layout has.
HTH

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by