Show Sidebar Hide Sidebar

Network Graphs in MATLAB

How to visualize a network with the adjacency matrix in MATLAB. An example of MATLAB's gplot function.

% Learn about API authentication here:
% Find your api_key here:

% Create the onnectivity graph of the Buckminster Fuller geodesic dome
[B, V] = bucky;
H = sparse(60, 60);
k = 31:60;
H(k, k) = B(k, k);

% Visualize the graph using the gplot function (blue)
fig = figure;
gplot(B - H, V, 'b-');
hold on;

% Visualize a rotation of the graph (red)
gplot(H, V, 'r-');
axis off equal;


% Strip MATLAB style by default!
response = fig2plotly(fig, 'filename', 'matlab-graph-plot');
plotly_url = response.url;
Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.