6

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 1

8

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

gplot_output

Sign up to request clarification or add additional context in comments.

2 Comments

+1, ditto. A practical example or a bit more juice in the answer would have not been bad, though.
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));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.