How to change FontSize and FontWeight of labels using labeledge?

77 次查看(过去 30 天)
How to change FontSize and FontWeight of labels using labeledge?
s = [1 1 2 2 3];
t = [2 3 3 4 4];
G = graph(s,t);
h = plot(G);
labelText = {'ABC' 'DEF' 'GHI'};
labeledge(h,[1 1 2],[2 3 3],labelText)
(I cannot see any mention of FontSize and FontWeight in the current labeledge's documentation)

采纳的回答

Ankit Kumar
Ankit Kumar 2019-10-22
Hi Simone,
You can change the FontSize and FontWeight of edge labels using GraphPlot Properties
In your case for example,
s = [1 1 2 2 3];
t = [2 3 3 4 4];
G = graph(s,t);
h = plot(G);
labelText = {'ABC' 'DEF' 'GHI'};
labeledge(h,[1 1 2],[2 3 3],labelText)
h.EdgeFontSize = 14;
h.EdgeFontWeight = 'Bold';
  3 个评论
Steven Lord
Steven Lord 2019-10-22
You can customize node and edge labels with font properties, including NodeFontSize and EdgeFontSize, as of release R2018b.
Sim
Sim 2019-10-23
编辑:Sim 2019-10-23
Thanks a lot Steven, I will download a newer version of Matlab...Hopefully it is possible with the same licence.. Thanks!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by