Graph Plot Layout Variation

2 visualizaciones (últimos 30 días)
Anushi1998
Anushi1998 el 5 de Jun. de 2017
Respondida: Steven Lord el 5 de Jun. de 2017
Hi,
I have a graph with many nodes and I have plot them according to their frequency.
scatter(nodes,freq);
Here is obtained image of plot
Now I need to create a directed graph on that plot without changing the position of the node.
I can draw it by plotting lines according to the edges but there is a problem in plotting arrow in mid of line & also how to consider multiple edges and loops.
The problem can look as we have to change the layout of the graph such that all nodes are aligned according to X-axis label and the height of each node is to be varied according to the frequency of that node.
If there is some direct function available that will be more appreciated.

Respuestas (1)

Steven Lord
Steven Lord el 5 de Jun. de 2017
Generate a digraph object (you'll need to know which nodes should be connected by edges) and plot it. When you plot the digraph, you can specify the XData and YData properties to control exactly where the nodes are plotted. The example "Custom Graph Node Coordinates" in the documentation shows this technique.

Categorías

Más información sobre Graph and Network Algorithms en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by