Displaying node name in a network graph

12 ビュー (過去 30 日間)
Mariya B
Mariya B 2016 年 4 月 14 日
コメント済み: jd net 2018 年 9 月 29 日
Hello All,
I seem to have an issue in displaying the node names. My code goes as follows:
names = 1:295;
node_names=reshape(cellstr(num2str(names(:))),* size(names)); %%assigning node names
A = sprand( 295, 295, density );%%creating sparse random adjacency matrix
G =graph(A,node_names);
ax=axesm('mercator','MapLatLimit',[40 41],'MapLonLimit',[-74 -73]);
setm(gca, 'origin',[-74.900,-73.750,-73.5340])
Thanks in advance
  1 件のコメント
jd net
jd net 2018 年 9 月 29 日
is this possible to implement......for PEG algorithm



Mike Garrity
Mike Garrity 2016 年 4 月 14 日
I think that it doesn't label them by default when the number of nodes gets bigger than some number. You can tell it that you really do want them by using the labelnode function.
It does get a bit "busy" though.
  3 件のコメント
jd net
jd net 2018 年 9 月 29 日


その他の回答 (0 件)


Find more on Networks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by