How can I reverse an edge in biograph viewer without redrawing the figure?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!