I have a graph consisting of a set of edges with their corresponding start and end nodes. These were generated for a specific region of a city. How can I visualize this graph in matlab
1 Answer
Check out this function:
doc gplot
Example:
% Plot half of a "Bucky ball" carbon molecule, placing asterisks at each node:
k = 1:30;
[B,XY] = bucky;
gplot(B(k,k),XY(k,:),'-*')
axis square

2 Comments
Luca Geretti
+1, ditto. A practical example or a bit more juice in the answer would have not been bad, though.
Paul English
Most graphs don't have coordinates from the start, matlab-bgl includes a few useful layout algorithms,
gplot(A, fruchterman_reingold_force_directed_layout(A));