Graph node/edge labels not showing on uiaxes

This code does not work as expected:
s = [1 1 1 2 2 3 3 4 5 5 6 7];
t = [2 4 8 3 7 4 6 5 6 8 7 8];
weights = [10 10 1 10 1 10 1 1 12 12 12 12];
names = {'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H'};
G = graph(s,t,weights,names);
ax = uiaxes();
plot(ax, G,'EdgeLabel',G.Edges.Weight)
It does not show node and edge labels.

4 comentarios

Vishal Chaudhary
Vishal Chaudhary el 26 de Sept. de 2018
The code is working correctly. The weights and node names are for visualization only.
It looks like the visualization of the graph differs from the one shown in documentation, but, the node connections, weights and node names are the same.
nemanjahrane
nemanjahrane el 30 de Sept. de 2018
In Matlab 2018b it is not showing the edge and node labels (although the connections are correct).
Tom
Tom el 28 de Feb. de 2019
Having exactly the same issue with uiaxes in the app designer. I have also copied and pasted the code above into a standalone script and I am getting the same result as nemanjahrane.
If I replace the uiaxes (in the code above) with a normal axes, the node and edge labels work fine, but unfortunately I can't do this in the app designer.
Also the code above works fine in R2017b (I don't have R2018a installed), but not in R2018b so I'm assuming it's a bug. Did you find a solution?
nemanjahrane
nemanjahrane el 28 de Feb. de 2019
After updating R2018b (Update 3) the problem is solved.

Iniciar sesión para comentar.

 Respuesta aceptada

Nemanja Hranisavljevic
Nemanja Hranisavljevic el 28 de Feb. de 2019

1 voto

R2018b Update 3 solves the problem. I suppose it was a bug.

1 comentario

Tom
Tom el 28 de Feb. de 2019
That's sorted it, thanks.
For anyone else seeing this, you can install update 3 in place by doing the following
On the Home tab, in the Environment section, select Add-Ons > Check for Product Updates. The Check for Updates dialog box displays

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graph and Network Algorithms en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Preguntada:

el 23 de Sept. de 2018

Comentada:

Tom
el 28 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by