Plot multiple edge sets on one graph?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Keaton Ellis
el 27 de Ag. de 2022
Comentada: Keaton Ellis
el 29 de Ag. de 2022
I have multiple adjacency matrices of digraphs that correspond to different relations over the same set of nodes. Is there a clean way for me to plot the different graphs using the same set of nodes?
0 comentarios
Respuesta aceptada
Chunru
el 28 de Ag. de 2022
% Create a graph
A = magic(4);
A(A>10) = 0;
names = {'alpha' 'beta' 'gamma' 'delta'};
G = digraph(A,names,'omitselfloops');
h1=plot(G);
% Now different edges
A(1,3)=0; A(1,2)=0;
G2 = digraph(A,names,'omitselfloops');
figure;
h2 = plot(G2)
% Ensure the node position does not change
h2.XData = h1.XData;
h2.YData = h1.YData;
Más respuestas (0)
Ver también
Categorías
Más información sobre Graph and Network Algorithms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!