Can i adjust nodes in digraph?

4 views (last 30 days)
Are there any way on how to adjust the nodes in the graph?

Accepted Answer

Christine Tobler
Christine Tobler on 17 Jan 2019
You can't directly drag the nodes of a GraphPlot object. Indirectly, you can modify the XData, YData and ZData properties of the object:
p = plot(graph('A', 'B'));
p.XData(1) = 3;
If you are up for a bit of configuration, here is a blog post which shows a way to allow the GraphPlot nodes to be dragged by mouse:

More Answers (1)

Walter Roberson
Walter Roberson on 17 Jan 2019
Edited: Walter Roberson on 17 Jan 2019
No, the callbacks simply are not there inside GraphPlot objects. You would have to fake it with axes level callbacks modifying coordinates inside the object. This is not as straight forward as it might seem as it is a non-trivial object and delegates a bunch to a Java Beans object too.

Categories

Find more on Graph and Network Algorithms in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!