Is it possible to remove labels added with labelnode?

I used this function to add some specific node labels
labelnode(G,selectedPoints, labels);
Now I want to remove (ALL) labels. How to do it?

 採用された回答

Adam Danz
Adam Danz 2019 年 11 月 26 日
編集済み: Adam Danz 2019 年 11 月 26 日

0 投票

Here's how to remove all labels and how to restore default labels
% Create demo GraphPlot
s = [1 1 2 2 3 4 5 5];
t = [2 3 3 4 4 5 1 2];
G = digraph(s,t);
h = plot(G); % Store handle!
labelnode(h,[1 2],{'source' 'target'})
% To reset labels
h.NodeLabelMode = 'auto';
% To remove all labels
h.NodeLabel = {};

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraph and Network Algorithms についてさらに検索

製品

リリース

R2016a

質問済み:

2019 年 11 月 26 日

編集済み:

2019 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by